-
Notifications
You must be signed in to change notification settings - Fork 6k
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
.SLN File not generating properly for aspnetcore scenarios due to intermediary "src" folder #7614
Comments
The problem seems to be related to the missing postSolution section in the solution. If you add this at the end it may fix the code generator GlobalSection(ExtensibilityGlobals) = postSolution |
Reposting my comment from #7945: The generated project path is missing backslashes. Looks like this is the case for 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? |
Same issue occurs in VS 2019 (16.4.5) as well. Can also remove and re-add the csproj from within Visual Studio and it loads just fine the second time. |
fixed by #10478 |
Description
Upon generating the Server Side Code, the project is unable to load in VS2017, claiming an unspecified error.
Swagger-codegen version
2.3.1
Swagger declaration file content or url
PetStore Example available from the Swagger.IO
Command line used for generation
java -jar .\swagger-codegen-cli-2.3.1.jar generate -i .\PetStore.yaml -l aspnetcore -o .
Power Shell 5, Latest version of Java
Steps to reproduce
Simply run the above command, and attempt to open in Visual Studio 2017.
Related issues/PRs
None that I could find.
Suggest a fix/enhancement
Removing / Re-Adding the CSProj File via the CLI resolves the issue:
dotnet sln IO.Swagger.sln remove .\src\IO.Swagger\IO.Swagger.csproj
dotnet sln IO.Swagger.sln add .\src\IO.Swagger\IO.Swagger.csproj
This results in a .sln file that is materially different, in that it has a reference to a project called "src" which is the default folder the code objects get generated to.
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{05A3DB7A-04CC-4CAB-A6E6-1C680BC0D6F2}"
Ultimately it appears as if the presence of that folder is tripping up visual studio's IDE. The project will build and run via CLI, this is purely is a Visual Studio Issue.
The text was updated successfully, but these errors were encountered: