Meisam Dehghan
Meisam Dehghan

Reputation: 188

Set the Environment to Development When Published to Server

I'd like my Asp.Net Core app to still run in the Development environment when published to Widnows server.The app is is being tested on our website and I'd like to see the details of exceptions. I've read bunch of articles on Stackoverflow,but didn't understand how to get it done.The articles talk about setting different environments,which sound pretty complicated and I don't need them.I'd appreciate it if someone could help me set the Development in web.config or somewhere else.

Upvotes: 1

Views: 271

Answers (1)

Artur
Artur

Reputation: 5522

In your Program.cs call UseEnvironment("Development")

public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
    WebHost.CreateDefaultBuilder(args)
    .UseEnvironment("Development")
    .UseStartup<Startup>();

Upvotes: 2

Related Questions