Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

Failed to generate swagger file. Error dotnet swagger tofile --serializeasv2 --output

Add below to the Configuration function of the Startup.cs file.
Make sure you use the same name ("test" here) and the "API URL suffix" in Azure.

services.AddSwaggerGen(c =>
{
	c.SwaggerDoc("test", new OpenApiInfo { Title = "TestAPI", Version = "v1" });
});

In the web deployment profile add below line under <ProprtyGroup>

<OpenApiDocumentName>v1</OpenApiDocumentName>
 
PREVIOUS NEXT
Tagged: #Failed #generate #swagger #Error #dotnet #swagger #tofile
ADD COMMENT
Topic
Name
5+4 =