Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[aspnetcore] .csproj doesn't load in Visual Studio 2017 #7945

Closed
TomSelleck101 opened this issue Mar 31, 2018 · 13 comments
Closed

[aspnetcore] .csproj doesn't load in Visual Studio 2017 #7945

TomSelleck101 opened this issue Mar 31, 2018 · 13 comments

Comments

@TomSelleck101
Copy link

Description

The generated aspnetcore project won't open in Visual Studio 2017 (tested with version 15.4.1).

Swagger-codegen version

Version 2.3.1 - hosted on editor.swagger.io

Swagger declaration file content or url

gist here

Command line used for generation

editor.swagger.io

Steps to reproduce
  1. Paste contents of gist into http://editor.swagger.io (Not https as the content can't be downloaded over https :/ )
  2. Click Generate Server
  3. Click aspnetcore
  4. Extract the folder from the downloaded .zip
  5. Open the .sln file to open with Visual Studio 2017
  6. The project says IO.Swagger (load failed) in the solution explorer
  7. Attempting to right click and reloading the project brings an error which says: The operation could not be completed. Unspecified error.
@TomSelleck101 TomSelleck101 changed the title aspnetcore solution file doesn't load in Visual Studio 2017 [aspnetcore] .csproj doesn't load in Visual Studio 2017 Mar 31, 2018
@jonathh21
Copy link

I too am experiencing this issue, vanilla code generated by Swagger UI won't load VS 2017 (15.6.4)

@cal5barton
Copy link

Just happened to me as well. VS 2017 (15.6.5)

@djmitchella
Copy link

Looks to be the same thing as #7614 - removing and re-adding the .csproj file resolves this.

@cal5barton
Copy link

@djmitchella That solved it for me. Thanks!

@antti88
Copy link

antti88 commented Apr 12, 2018

That worked for me too! Thanks!

@tkieronski
Copy link

Interesting thought that you can still open the solution without any issues on Mac Visual Studio but not on Windows.

@Monte-Christo
Copy link

The project also loads without a problem in Visual Studio Code.
Upon removing and re-adding, two changes are made to the .sln file:

  1. The project GUID is changed.
  2. This added to the end of the file:
    GlobalSection(ExtensibilityGlobals) = postSolution
    SolutionGuid = {some GUID}
    EndGlobalSection

@eeskildsen
Copy link

eeskildsen commented Jan 9, 2019

The generated project path is missing backslashes. Looks like this is the case for csharp too.

Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "IO.Swagger", "srcIO.SwaggerIO.Swagger.csproj", "{C90F1986-9E16-4F6B-86EE-9E22593A9ED9}"

I'm guessing this has to do with how Mustache handles backslashes?

@GreatJobBob
Copy link

Here what worked for me
I created a new blank solution in Visual Studio
I added a new .Net Core API project
Then added an existing project and selected my generated swagger project
Then made that project start up project.
Rebuild solution then ran fine

@TheBeardedLlama
Copy link

I'm having the same issue, but I can't even open the csproj on its own.

When I first try to open the project I get
image

If I try to reload then I get:
image

@roryvidalburgoa
Copy link

I've just removed the project from the solution and re-added it. It worked.

@HugoMario
Copy link
Contributor

Hi @TheBeardedLlama @GreatJobBob @roryvidalburgoa
i'm not familiar with net but if you let me know which changes are required to fix this i could help

@HugoMario
Copy link
Contributor

fixed by swagger-codegen#10478

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests