简体   繁体   English

生成 swagger 文件时无法在 Azure 应用服务上发布

[英]Failed to publish on Azure App Service while Generating swagger file

I am getting this error when I try to publish my ASP.NET Web API to Azure App Service.当我尝试将我的 ASP.NET Web API 发布到 Azure App Service 时出现此错误。

错误生成招摇

In Temp File Create a log give Below在临时文件中创建一个日志给下面

6/21/2022 10:44:14 PM Microsoft.WebTools.Shared.Exceptions.WebToolsException: Failed to update your API in Azure (Status code: BadRequest). 2022 年 6 月 21 日晚上 10:44:14 Microsoft.WebTools.Shared.Exceptions.WebToolsException:无法在 Azure 中更新您的 API(状态代码:BadRequest)。

at Microsoft.WebTools.Azure.Publish.ApiMApi.BaseApiMApiUpdater.d__10.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.WebTools.Azure.Publish.ApiMApi.AppServiceApiMApiPublishHandler.AppServiceApiMApiUpdater.d__10.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.WebTools.Azure.Publish.ApiMApi.BaseApiMApiUpdater.d__9.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAn在 Microsoft.WebTools.Azure.Publish.ApiMApi.BaseApiMApiUpdater.d__10.MoveNext() --- 从先前引发异常的位置结束堆栈跟踪 --- 在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务) System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.WebTools.Azure.Publish.ApiMApi.AppServiceApiMApiPublishHandler.AppServiceApiMApiUpdater.d__10.MoveNext() --- 从先前抛出异常的位置结束堆栈跟踪---在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 在 Microsoft.WebTools.Azure.Publish.ApiMApi.BaseApiMApiUpdater.d__9.MoveNext() --- End从以前抛出异常的位置的堆栈跟踪 --- 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAn 的 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) dDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) at Microsoft.WebTools.Azure.Publish.ApiMApi.AppServiceApiMApiPublishHandler.d__13.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) at Microsoft.WebTools.Azure.Publish.PublishProviders.AppServicePublishProfileVisual.d__56.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Publish.Framework.Nexus.PublishProfilesServiceImpl.ServerProjectProfilesManager.d__55.MoveNext() dDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) at Microsoft.WebTools.Azure.Publish.ApiMApi.AppServiceApiMApiPublishHandler.d__13.MoveNext() --- 堆栈跟踪从上一个异常位置结束抛出 --- 在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 在 System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) 在 Microsoft.WebTools .Azure.Publish.PublishProviders.AppServicePublishProfileVisual.d__56.MoveNext() --- 从先前引发异常的位置结束堆栈跟踪---在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 在 System.Runtime。 Microsoft.Publish.Framework.Nexus.PublishProfilesServiceImpl.ServerProjectProfilesManager.d__55.MoveNext() 上的 CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务)

=================== ====================

According to the screenshot information, the process of website publishing has been completed.根据截图信息,网站发布流程已经完成。 It's just that swagger.json is not updated.只是 swagger.json 没有更新。

By searching this issue, I think there are two alternatives below, which should help you.通过搜索这个问题,我认为下面有两种选择,应该对你有所帮助。

1. By modifying the configuration, the swagger.json file is generated at compile time. 1、通过修改配置,在编译时生成swagger.json文件。
(Please modify the path.) (请修改路径。)

2. Disable update the api during publish. 2.在发布期间禁用更新api。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 发布到azure应用服务计划,找不到文件 - Publish to azure app service plan, file not found Azure 发布生成 swagger 文件失败 - Azure Publish generate swagger file fails Azure 应用服务无法从 visual studio 2019 发布 - Azure App service cannot publish from visual studio 2019 Azure应用服务API获取FileNotFoundException:尝试启动时无法找到文件'D:\\ home \\ site \\ wwwroot \\ MyApi.xml - Azure App Service API gets FileNotFoundException: Could not find file 'D:\home\site\wwwroot\MyApi.xml when trying to start swagger 无法发布 ASP.NET Web API 到 Z3A580F142203677F1FZ3 应用服务 - Cannot publish ASP.NET Web API to Azure App Service 我想发布项目时无法恢复 csproj 文件 - Failed to restore csproj file while i want to publish project 使用 Azure 服务总线发布/订阅 - Publish/subscribe with Azure Service Bus Azure 发布:无法更新 Azure 中的 API - Azure publish: Failed to update API in Azure 使用Azure App Service中托管的WCF服务时出现凭据错误 - Credential Error while consuming the WCF Service hosted in Azure App Service 如何将 Blazor Web 程序集与 ASP.NET 核心托管和身份验证应用程序发布到 ZCF04A02E37B774FC3917A 服务? - How to publish Blazor Web assembly with ASP.NET core hosting and identity auth app to azure App Service?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM