-
Notifications
You must be signed in to change notification settings - Fork 10k
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
VS client generation causes build errors for default template #43987
Comments
You can workaround this issue by specifying a different namespace for the generated code when configuring the OpenApi service in VS but it's still a bit of a gotcha if you aren't familiar with how the internals of the code generator work. + namespace WebApplicationFoo
- namespace WebApplication4 |
This came up during triage today and there was some inquiry as to whether or not this issue occurred in .NET 6. Well, when I try this out, I run into #43391 since we didn't update getdocument to support the new hosting pattern in .NET 6. I opened #44215 to track backporting the fix to 6.0. We'll probably want to fix the major issue of it not working in .NET 6 before we determine whether or not this particular regression exists in 6.0 |
Update: servicing PR for 6.0.11 has been approved (#44227). We'll have to verify this once we have a build of 6.0.11. |
I worked around this by saving the swagger.json from the web endpoint instead of generating it in the CLI. Can confirm that this also happens in net6.0. |
Is there an existing issue for this?
Describe the bug
Running VS client generation on a basic ASP.NET web template produces compilation errors.
Expected Behavior
Generating a Swagger client via VS client generation should not cause any compilation errors.
Steps To Reproduce
.csproj
to include the following so aswagger.json
file is generated on build.obj/swaggerClient.cs
to view the generated code.Exceptions (if any)
No response
.NET Version
7.0.100-rc.2.22419.24
Anything else?
[System.CodeDom.Compiler.GeneratedCode("NSwag", "13.0.5.0 (NJsonSchema v10.0.22.0 (Newtonsoft.Json v11.0.0.0))")]
Microsoft Visual Studio Enterprise 2022
Version 17.4.0 Preview 1.0
VisualStudio.17.Preview/17.4.0-pre.1.0+32804.182
Microsoft .NET Framework
Version 4.8.04161
Installed Version: Enterprise
Visual C++ 2022 00476-80000-00000-AA685
Microsoft Visual C++ 2022
ASP.NET and Web Tools 17.4.86.38009
ASP.NET and Web Tools
Azure App Service Tools v3.0.0 17.4.86.38009
Azure App Service Tools v3.0.0
Azure Functions and Web Jobs Tools 17.4.86.38009
Azure Functions and Web Jobs Tools
C# Tools 4.4.0-1.22403.13+ebbf56c257fb4d3128d3487ef525d92e9f94b412
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
Microsoft Azure Tools for Visual Studio 2.9
Support for Azure Cloud Services projects
Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines
NuGet Package Manager 6.4.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/
Project System Tools 1.0
Tools for working with C#, VisualBasic, and F# projects.
Razor (ASP.NET Core) 17.0.0.2237602+b10895cdddd2286fe448ca44dfeb6f9c2c4f6abd
Provides languages services for ASP.NET Core Razor.
SQL Server Data Tools 17.0.62207.28050
Microsoft SQL Server Data Tools
Syntax Visualizer 1.0
An extension for visualizing Roslyn SyntaxTrees.
Test Adapter for Boost.Test 1.0
Enables Visual Studio's testing tools with unit tests written for Boost.Test. The use terms and Third Party Notices are available in the extension installation directory.
Test Adapter for Google Test 1.0
Enables Visual Studio's testing tools with unit tests written for Google Test. The use terms and Third Party Notices are available in the extension installation directory.
TypeScript Tools 17.0.10727.2001
TypeScript Tools for Microsoft Visual Studio
Visual Basic Tools 4.4.0-1.22403.13+ebbf56c257fb4d3128d3487ef525d92e9f94b412
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Visual F# Tools 17.4.0-beta.22376.4+0e8a2053cc2fc7d3801205a873e0afd3b6a1235e
Microsoft Visual F# Tools
Visual Studio IntelliCode 2.2
AI-assisted development for Visual Studio.
The text was updated successfully, but these errors were encountered: