After deploying my asp.net core app to azure for the first time and ran it, I got the following error:
Error. An error occurred while processing your requ
thanks for your comments. I was able to find error details by adding the following key in application settings in azure portal: ASPNETCORE_ENVIRONMENT with value: Development
I have created a new question regarding the error itself: InvalidOperationException: Could not find 'UserSecretsIdAttribute' on assembly
Thank you
It is a security measure used in production mode so that any user does not got sensitive exception information from our app.
You can change ASPNETCORE_ENVIRONMENT from "Production" to "Development".
Another option is to change the code for the Configure () method in Startup.cs. It is this method makes a validation:
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Error");
}
...
}
It is not recommended, but you can eliminate this condition:
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
app.UseDeveloperExceptionPage();
...
}
Just so it's clear - still something that comes up in ASP.NET Core 2.0 - and as @Techy stated - is in Azure. Go to Azure, click on your Web App –> "Applications Settings" –> go down to the “App Settings” section and add the “ASPNETCORE_ENVIRONMENT” and “Development”