ASP.NET CORE dotnet run 命令使用debug方式運行


由於我的開發環境比較復雜,每次調試一套項目都要啟動好幾個VS,比較繁瑣,今天決定換一種方式調試,對於不該改動的代碼的附加項目直接使用dotnet run命令以debug的運行方式運行,

一開始無法運行dubug方式,我需要的是Hosting environment: Development模式,后來在谷歌搜索找到了答案,不得不說百度真的很難找到解決方法,基本都是CTRL+C ,CTRL+V.

方法也很簡單,windows 環境變量里面添加name= ASPNETCORE_ENVIRONMENT value=Development 的環境變量即可。

Using the windows control panel

If you're not a fan of the command prompt, you can easily update your variables using your mouse!Click the windows start menu button (or press the Windows key), search for environment variables, and choose Edit environment variables for your account:

Searching for control panel in start menu

Selecting this option will open the System Properties dialog:

System properties dialog

Click Environment Variables to view the list of current environment variables on your system.

Environment variables window

Assuming you do not already have a variable called ASPNETCORE_ENVIRONMENT, click the New... button and add a new account environment variable:

Adding a new environment variable

Click OK to save all your changes. You will need to re-open any command windows to ensure the new environment variables are loaded.


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM