【问题标题】:Deploying To Azure throws Http Status 500 when from Command Line and works when from VS'17从命令行部署到 Azure 会抛出 Http Status 500,而从 VS'17 部署到 Azure 会抛出 Http Status 500
【发布时间】:2019-10-12 20:00:28
【问题描述】:

我正在尝试使用命令行部署到 Azure:

nuget restore MySolution.sln

msbuild MySolution.WebApi /P:DeployOnBuild=True /p:UserName='userName'    /p:PassWord='pass'  /p:PublishProfile=$publishProfile

部署工作正常,没有抛出错误。 检查 API 时,我收到以下错误:

**HTTP Error 500.0 - Internal Server Error**
* IIS received the request; however, an internal error occurred during the processing of the request. The root cause of this error depends on which module handles the request and what was happening in the worker process when this error occurred.
* IIS was not able to process configuration for the Web site or application.

当我使用 VS 17 使用相同的发布配置文件部署 APP 时,我可以验证 API 没有引发错误。它工作正常。

嗯,我检查了 Web.Config、App.json 和 buildConfig.json,它们都是一样的。

还有什么可能导致这种情况?

【问题讨论】:

    标签: c# azure powershell asp.net-web-api internal-server-error


    【解决方案1】:

    我缺少一个输出路径。

    msbuild MySolution.WebApi /t:Build  /p:Configuration='MyConfig' /p:OutputPath=$outputPath  /P:DeployOnBuild=True /p:UserName='userName'    /p:PassWord='pass' /p:PublishProfile=$publishProfile
    

    【讨论】:

      猜你喜欢
      • 2014-09-05
      • 2018-01-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-22
      相关资源
      最近更新 更多