This article is a mirror article of machine translation, please click here to jump to the original article.

View: 36070|Reply: 3

[Source] .NET Core determines the running system environment and sets environment variables

[Copy link]
Posted on 2021-9-17 21:22:55 | | | |
Windows and Linux have a big difference in disk storage directory structure, Windows has a drive letter, while Linux does not have the concept of a drive letter, when developing a asp.net core website, you may need to create the corresponding file directory according to the system.

Judge the current system


.NET Core runs environment variable settings under different systems


1、Windows

Right-click the computer directly to manually add environment variables. Added system variables ASPNETCORE_ENVIRONMEN

2、Linux



3、docker

docker configuration with the -e parameter when starting the container







Previous:.NET Core develops Windows Forms programs
Next:A must-have DebugView debugging tutorial for developers
Posted on 2021-9-19 19:42:01 |
This is not bad either
Posted on 2021-10-24 18:06:50 |
 Landlord| Posted on 2025-7-28 10:06:23 |
ASP.NET Core View view to determine which environment is currently running

Print the current environment:
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com