小编Ras*_*sha的帖子

ASP.NET API 无法在 Azure 上发布

我正在尝试将 C# API 发布到 azure,我遵循了本文档中的所有步骤,但由于某种原因,当我发布应用程序时,构建会成功,但在执行以下行时会崩溃

Generating swagger file to 'C:\Users\user\Projs\API\bin\Release\netcoreapp3.1\swagger.json'.
Run Code Online (Sandbox Code Playgroud)

打印的唯一错误日志是

Failed to generate swagger file. Error dotnet swagger tofile --serializeasv2 --output "C:\Users\user\Downloads\Projs\API\bin\Release\netcoreapp3.1\swagger.json" "C:\Users\user\Downloads\Projs\API\bin\Release\netcoreapp3.1\API.dll" v1

Unhandled exception. System.IO.FileLoadException: Could not load file or assembly 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The located assembly's manifest definition does not match the assembly reference. (0x80131040)
File name: 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'




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 …
Run Code Online (Sandbox Code Playgroud)

.net c# asp.net azure swagger

6
推荐指数
1
解决办法
3014
查看次数

标签 统计

.net ×1

asp.net ×1

azure ×1

c# ×1

swagger ×1