简体   繁体   中英

IIS ASP.NET Core app failed to start after deploying

When accessing my .NET 5 API in IIS:

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

"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. 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
  2. Run the application using the command 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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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