Development environment shouldn't be enabled for deployed applications

Shawn Mccabe 0 Reputation points
2025-04-21T21:37:33.61+00:00

Error.

An error occurred while processing your request.

Request ID: 00-d84212a0f0ecfa85b5326f4b940d2d41-8ce5b9e91288d76d-00

Development Mode

Swapping to Development environment will display more detailed information about the error that occurred.

The Development environment shouldn't be enabled for deployed applications.

It can result in displaying sensitive information from exceptions to end users.

For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT

environment variable to Development and restarting the app.

Azure Web PubSub
Azure Web PubSub
An Azure service that provides real-time messaging for web applications using WebSockets and the publish-subscribe pattern.
97 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Harshitha Veeramalla 1,301 Reputation points Microsoft External Staff Moderator
    2025-04-24T11:18:38.6266667+00:00

    Hi Shawn Mccabe,

    I have created a sample ASP.N ET Core Web app and explicitly threw a error in the controller.

    public IActionResult Index()
     {
         throw new Exception("This is a test exception");
         return View();
     }
    
    • Even I got the same error initially in the error page.

    enter image description here

    • As suggested in the message, I have set ASPNETCORE_ENVIRONMENT=Production in the Environment Variables section.

    enter image description here

    • That is just a static content which is generated by default with the ASP.NET Core template in Views => Shared => Error.cshtml page.

    enter image description here

    • Remove that para, save and publish the app.

    enter image description here

    Hope this helps


    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.