简体   繁体   English

IIS ASP.NET Core 应用程序在部署后无法启动

[英]IIS ASP.NET Core app failed to start after deploying

When accessing my .NET 5 API in IIS:在 IIS 中访问我的 .NET 5 API 时:

HTTP Error 500.30 - ASP.NET Core app failed to start

According to the logs:根据日志:

Unhandled exception. System.ArgumentNullException: Value cannot be null. (Parameter 
'authKeyOrResourceToken') 
at Microsoft.Azure.Cosmos.AuthorizationTokenProvider.CreateWithResourceTokenOrAuthKey(String 
authKeyOrResourceToken)
at Microsoft.Azure.Cosmos.CosmosClient..ctor(String accountEndpoint, String 
authKeyOrResourceToken, CosmosClientOptions clientOptions)

And my code setup looks like this (not using mongo) for my login details对于我的登录详细信息,我的代码设置看起来像这样(不使用 mongo)

"CosmosDb": 
{
"Account": "https://mydb.documents.azure.com:443/",
"Key": "iputmykeyhere",
"DatabaseName": "my-db"
}

Any idea what else to look for?知道还有什么要找的吗?

The "HTTP Error 500.30" error most often occurs when the .NET Core web application fails to start up. “HTTP 错误 500.30”错误最常发生在 .NET Core Web 应用程序无法启动时。 This means that the troubleshooting step suggestion the error message gives you will not work.这意味着错误消息为您提供的故障排除步骤建议将不起作用。 If the application can not start up, then you can not attach a debugger to it.如果应用程序无法启动,则您无法为其附加调试器。 if can, you can try to debug this error using the steps below:如果可以,您可以尝试使用以下步骤调试此错误:

  1. Navigate to the root directory of the application using CMD使用 CMD 导航到应用程序的根目录
  2. Run the application using the command dotnet run (yourApplicationName).dll使用命令 dotnet run (yourApplicationName).dll 运行应用程序

If there are any errors, they should appear in the output.如果有任何错误,它们应该出现在输出中。

If you still can't solve the problem, you can refer to this link: HTTP Error 500.30 - ASP.NET Core app failed to start .如果仍然无法解决问题,可以参考这个链接: HTTP Error 500.30 - ASP.NET Core app failed to start

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM