Amy Zeng
Amy Zeng

Reputation: 63

How to set Development environment in V.S.Code?

I am using V.S Code to develop an Asp.net Core project. I tried to set the environment to "Development" by setting it in cmd line with setx ASPNETCORE_ENVIRONMENT "Development" or/and changing settings in Launch.json with

"env": {
                "ASPNETCORE_ENVIRONMENT": "Development"
        },

as showed in the attached picture below, but seems the environment is still "Production". Did I miss anything? Thanks!

Setting "Development" in V.S Code

Upvotes: 5

Views: 5996

Answers (1)

Anand R P
Anand R P

Reputation: 21

The environment variables will not take effect if we run directly from the terminal.

Instead, click the "Run and Debug" menu on the left and chose the name of the configuration profile where the environmental variables are added, then click the "Run" icon.

Upvotes: 1

Related Questions