I have noticed this is a big issue for many and it is stopping me from getting deployed to Azure. I have two APIs and a website and I am building a PaaS integration. This issue is keeping me from getting my applications migrated and my APIs will not work because of it. Anyway, I get the error listed below when attempting to Publish to my App Service. As we all know there is not a StartUp.cs file with a .net 8 Web Api. The application works and runs great locally, but I cannot get it to communicate between the Web App and the Web APIs. I successfully log in using B2C user flows. Everything is configured using connected services connection so I have all secret information in Key Vault. I am also using Azure Storage, and Azure API Manangement. I have been stuck on this for 3 days and because of that I have upgraded my support subscription to Standard. Anyway, I need help. Thanks.
Failed to generate swagger file. Error dotnet swagger tofile --serializeasv2 --output "C:\Users\TroyC\Source\repos\EMSAPI\bin\Release\net8.0\swagger.json" "C:\Users\TroyC\Source\repos\EMSAPI\bin\Release\net8.0\EMSAPI.dll" v1
Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'Swashbuckle.AspNetCore.Swagger, Version=6.5.0.0, Culture=neutral, PublicKeyToken=62657d7474907593'. The system cannot find the file specified.
File name: 'Swashbuckle.AspNetCore.Swagger, Version=6.5.0.0, Culture=neutral, PublicKeyToken=62657d7474907593'
at Swashbuckle.AspNetCore.Cli.Program.<>c.<main>b__0_4(IDictionary`2 namedArgs)
at Swashbuckle.AspNetCore.Cli.CommandRunner.Run(IEnumerable`1 args) in C:\projects\ahoy\src\Swashbuckle.AspNetCore.Cli\CommandRunner.cs:line 68
at Swashbuckle.AspNetCore.Cli.CommandRunner.Run(IEnumerable`1 args) in C:\projects\ahoy\src\Swashbuckle.AspNetCore.Cli\CommandRunner.cs:line 59
at Swashbuckle.AspNetCore.Cli.Program.Main(String[] args) in C:\projects\ahoy\src\Swashbuckle.AspNetCore.Cli\Program.cs:line 121
Be sure that the Startup.cs for your application is calling AddSwaggerGen from within ConfigureServices in order to generate swagger file. Visit https://go.microsoft.com/fwlink/?LinkId=2131205&CLCID=0x409 for more information.