从命令行部署到 Azure 时会抛出 Http Status 500,而在 VS'17 时会工作
Deploying To Azure throws Http Status 500 when from Command Line and works when from VS'17
我正在尝试使用命令行部署到 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 使用相同的发布配置文件部署应用程序时,我可以验证 API 没有抛出任何错误。它工作正常。
嗯,我检查了Web.Config、App.json和buildConfig.json,它们都是一样的。
还有什么可能导致这种情况?
我缺少输出路径。
msbuild MySolution.WebApi /t:Build /p:Configuration='MyConfig' /p:OutputPath=$outputPath /P:DeployOnBuild=True /p:UserName='userName' /p:PassWord='pass' /p:PublishProfile=$publishProfile
我正在尝试使用命令行部署到 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 使用相同的发布配置文件部署应用程序时,我可以验证 API 没有抛出任何错误。它工作正常。
嗯,我检查了Web.Config、App.json和buildConfig.json,它们都是一样的。
还有什么可能导致这种情况?
我缺少输出路径。
msbuild MySolution.WebApi /t:Build /p:Configuration='MyConfig' /p:OutputPath=$outputPath /P:DeployOnBuild=True /p:UserName='userName' /p:PassWord='pass' /p:PublishProfile=$publishProfile