Very simple ASP .NET core application so far. I've turned on the developer exception page as follows
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
loggerFactory.AddDebug();
app.UseDeveloperExceptionPage();
app.UseMvc();
}
I've deployed it on windows as a portable app and i'm able to see the errors on the developer page (awesome page by the way) when a specific web API request fails with an exception.
I publish the same app to Ubuntu as a self-contained app and I don't get the developer error page to show up (though the seems to run fine - i've hard coded an error just to test the developer page itself).
The Developer Exception Page is for use when the environment is Development.
See https://www.exceptionnotfound.net/working-with-environments-and-launch-settings-in-asp-net-core/
The act of publishing the app to Ubuntu is setting the environment to Production.
By default on macOS and Linux ASP.NET Core's Hosting environment is Production.
On Ubuntu you can start the application and set the Hosting environment from command line using
> dotnet run --environment=Development
For macOS:
$ ASPNETCORE_ENVIRONMENT=Development dotnet run
If you are using Visual Studio Code, in launch.json there's the following setting for each configuration:
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With