Azure WebApp Asp.NET Core 2 error: An error occurred while starting the application
I have upgraded asp.net core 1.1 to an asp.net core 2. It runs fine on the local server, but when I try to deploy it to an Azure hosted web app, I received the error:
An error occurred while starting the application. .NET Core
4.6.00001.0 X86 v184.108.40.206 | Microsoft.AspNetCore.Hosting version 2.0.0-rtm-26452 | Microsoft Windows 6.2.9200
Please add ASPNETCORE_DETAILEDERRORS = true in app settings of your app, restart it and see the detailed error next time you load the url. That will help you fix it.
For example, error in my case was that I didn't have the managed identity of my API App configured to access the Key Vault to get the storage account and Cosmos DB keys. I used startup to inject the configured storage and cosmos db objects hence it was failing the moment I was starting my app.
How to handle “An error occurred while starting the application” in , As the error message implies something get's really bad while IIS was trying to start up your application. stdoutLogFile points to an folder (not file) which must exist while IIS will restart next time. Otherwise you won't see any logs. So when you’re creating your Azure web app (hosted on windows OS) and deploying some ASP.NET Core app you might see the following like I did the last time:
- Open your web.config
- Change stdoutLogEnabled=true
- Create a logs folder Unfortunately, the AspNetCoreModule doesn’t create the folder for you by default If you forget to create the logs folder, an error will be logged to the Event Viewer that says: Warning: Could not create stdoutLogFile \?\YourPath\logs\stdout_timestamp.log, ErrorCode = -2147024893. The "stdout" part of the value ".\logs\stdout" actually references the filename not the folder. Which is a bit confusing. Run your request again, then open the \logs\stdout_*.log file
Note – you will want to turn this off after you’re done troubleshooting, as it is a performance hit.
So your web.config’s aspNetCore element should look something like this
Azure Web App "An error occurred while starting the application , An error occurred while starting the application. .NET Core X86 v220.127.116.11 | Microsoft.AspNetCore.Hosting version NET Core Web App), importing the deploy profile, and deploying. Also, the Saturday, April 15, 2017 2:05 PM. Other Posts. Quantum Computing basics with Q# – The superposition of a qubit May 10, 2020; How to make authenticated requests to an ASP.NET Core web API using IdentityServer4 with Client Credentials.
DetailedErrorsKey in the
Program.cs so you can figure it out what's happening.
WebHost.CreateDefaultBuilder(args) .UseSetting(WebHostDefaults.DetailedErrorsKey, "true")
How to troubleshoot: “An error occurred while starting the application”, The Problem If you've ever seen this message when hitting your ASP.NET Core app: "An error occurred while starting the application. This is because Event Logging must be wired up explicitly and you'll need to use the Microsoft.Extensions.Logging. It helped me for asp.net core in azure. LikeLiked by Sorry for the late response Tayo… I’m not really sure to be honest as I’m not familiar with AppHarbor. If they let you throttle up the logging some how that seems like the best bet.
You can obtain more details by enabling
ASPNETCORE_DETAILEDERRORS = true:
go to your Azure Dashboard -> Your App Service
In your application Settings (in the left hand sidebar) -> scroll down to configuration which is a key:value pair of settings, input the above. Restart your web app.
Try executing the application by firing the command
This shall throw the startup errors and may help you narrow down the error.
Web App Publishing - An error occurred while , "An error occurred while starting the application" on app launch after successful deployment of a web app via Visual Studio on Azure cloud. To host an app that uses an ASP.NET Core preview release, see Deploy ASP.NET Core preview release to Azure App Service. OS upgrade removed the 32-bit ASP.NET Core Module Application Log: The Module DLL C:\WINDOWS\system32\inetsrv\aspnetcore.dll failed to load.
An error occurred while starting the application. .NET Core 4.6 , An error occurred while starting the application. .NET Core NET Core 4.6.27129.04 X64 v18.104.22.168 | Microsoft.AspNetCore. Error Number:-2,State:0,Class:11. I've been developing an ASP.NET Core web app, based largely on the MVC template provided in Visual Studio 2017 RC2. It runs just fine in local debug mode, but when I try to publish it to an Azure hosted web app, I get this error:
an error occurred while starting the application after publishing dot , Azure WebApp Asp.NET Core 2 error: An error occurred while , Please add ASPNETCORE_DETAILEDERRORS = true in app settings of your app, restart it and To host an app that uses an ASP.NET Core preview release, see Deploy ASP.NET Core preview release to Azure App Service. Application Event Log (Azure App Service) To access the Application Event Log, use the Diagnose and solve problems blade in the Azure portal:
ASP.NET Core 1.1 runs fine locally but when publishing to Azure , An error occurred while starting the application. .NET Core Try to enable the developer friendly error messages at startup by setting the . For ASP.NET Core 1.x. public static void Main(string args) is complete so as not to expose your application to malicious attacks. Net Core Web Application (. I have an ASP.NET 5 solution with a website and several project libraries. I'm using MVC 6 and Entity Framework 7. Locally the app is working fine and until today it was working also on Azure deplo