[英]Dot NET Core Hosting Environment for Visual Studio for Mac
Trying out the new Visual Studio for Mac preview. 试用新的Visual Studio for Mac预览。 Dotnet core mvc project compiles and runs perfectly :D:D:D
Dotnet核心mvc项目可以编译并完美运行:D:D:D
Only problem is; 唯一的问题是; It uses the default Hosting environment: Production.
它使用默认的托管环境:生产。
I have tried to put export ASPNETCORE_ENVIRONMENT=Development inside my bash profile and export it in my terminal. 我试图将导出ASPNETCORE_ENVIRONMENT =开发放入我的bash配置文件中,并将其导出到我的终端中。
Running dotnet in cli works fine with that environment but not in Visual Studio for Mac. 在cli中运行dotnet可以在该环境下正常运行,但在Visual Studio for Mac中则不能。
I can't seem to find where I can add the environment variable it should use when debugging. 我似乎找不到在哪里可以添加调试时应使用的环境变量的位置。
Ok I was being a bit of a moron. 好吧,我有点白痴。
You have to right click on the project and NOT the solution. 您必须右键单击项目,而不是解决方案。 - Options - Run Configurations Default - Environment Variables
-选项-运行配置默认-环境变量
只是要添加到原始答案:就我而言,我必须重新启动Visual Studio才能使环境变量正常工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.