Simone Spagna
Simone Spagna

Reputation: 29

Set Development Enviroment for a specific .NET Core Web Application

I've a .Net Core 3.1 web application published on IIS. I want to force enviroment type to development in order to run api that are not allowed in production.

I run the command :

setx ASPNETCORE_ENVIRONMENT "Development"

and then I run:

iisreset

as specified in this article How to set ASPNETCORE_ENVIRONMENT to be considered for publishing an ASP.NET Core application but the enviroment type seems to always remain production.

I try to run the API via a ngrok tunnel. Any suggestion? Thanks. Simone

Upvotes: 0

Views: 125

Answers (1)

Aman B
Aman B

Reputation: 2388

You need to pass /M flag to setx command:

setx ASPNETCORE_ENVIRONMENT Development /M

The /M switch sets the environment variable at the system level. If the /M switch isn't used, the environment variable is set for the user account.

You can read more about it here

Upvotes: 1

Related Questions