Reputation: 1562
My project is in .Net Core 1.1 and cosmosDB backend. We are using Auth0 as authentication. After login, user can enter data and save it in there MANAGE PAGE. While saving we are storing user name (most of the time its a Email address) in the same record. Everything working fine. But for some users I'm getting this error,
Swapping to Development environment will display more detailed information about the error that occurred. Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application.
I checked in SO and some other blogs. As they suggest to change the ASPNETCORE_ENVIRONMENT to Production in lunchSettings.json in the project. But there is no luck.
What I'm doing, everytime I changed my code in development, I commit my code to SVN then Publish it, like everyone do.
Note: I don't have web.config file and I dont want to add that manually.
Upvotes: 1
Views: 5302
Reputation: 1318
Knowing that you are not running your application in debug, but rather published it on Azure (as posted in comment) you have to change your environment variable in Azure. launchSettings.json is not meant for that.
I have found an answer which is describing how to configure it on Azure, so I won't be repeating here: How and where to define an environment variable on azure
Hope that helps.
Upvotes: 1