How to debug an ASP.NET Core MVC application deployed in Azure

I created a simple ASPNET Core 1.0 MVC application that I am trying to deploy to Azure using Visual Studio. I can run this application locally on my machine using IIS Express and go to my default route and display the page. However, in Azure, I always get 500 errors every time, and at this point I don’t understand how to get additional information.

I turned on verbose query logging in my Azure application, but it really doesn't tell me much.

ModuleName="AspNetCoreModule", Notification="EXECUTE_REQUEST_HANDLER", HttpStatus="500", HttpReason="Internal Server Error", HttpSubStatus="0", ErrorCode="The operation completed successfully. (0x0)", ConfigExceptionInfo="" 

I disabled my startup configuration to the right things

 public void ConfigureServices(IServiceCollection services) { services.AddMvc(); } public void Configure(IApplicationBuilder app, ILoggerFactory loggingFactory) { loggingFactory.AddConsole(); loggingFactory.AddDebug(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}" ); }); } 

Something should explode in the MVC pipeline, but I don't know how to add more visibility. What can I do to get more information?

And in case that matters, this is my Program.cs

 var host = new WebHostBuilder() .UseKestrel() .UseContentRoot(Directory.GetCurrentDirectory()) .UseIISIntegration() .UseStartup<Startup>() .Build(); host.Run(); 
+5
source share
1 answer

Try setting ASPNETCORE_ENVIRONMENT to Development to display the full error message on the error page.

Application settings

Remember to turn it off when done, otherwise you will receive error information.

+12
source

All Articles