使用vnext(ASP.NET 5 RC1 Update1)在Mac中设置托管环境变量 [英] Set hosting environment variables in Mac using vnext (ASP.NET 5 RC1 Update1)

查看:50
本文介绍了使用vnext(ASP.NET 5 RC1 Update1)在Mac中设置托管环境变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Windows和Mac上的Web应用程序中工作.在带有VS2015社区的Windows中,我可以使用VS2015(属性Web项目)来更改环境变量.

I'm working in my web app in Windows and Mac. In Windows with VS2015 Community I can change the environment variables using the VS2015 (properties web project).

在Mac中,我已经使用 export 命令进行了测试,但是当我退出终端时,环境变量将被删除.

In Mac, I have tested with the command export but when I exit of the terminal, the environment variable is deleted.

export ASPNET_ENV="Development"

在Mac中启动项目时,我看到:

When I start the project in Mac, I see:

Hosting environment: Production
Now listening on: http://localhost:5000
Application started. Press Ctrl+C to shut down.

如何更改托管环境?以及如何添加更多永久变量?谢谢!

How can I change the Hosting Environment? And How can I add more permanents variables? Thanks!!

推荐答案

如果您正在从终端运行导出,则导出仅适用于该会话.为了使该变量在会话之外可以看到,您应该将变量导出到〜/.profile 〜/.bashrc

If you are running export from a terminal, the export is only good for that session. For the variable to be seen by things outside of that session, you should export the variable in your ~/.profile or ~/.bashrc

这篇关于使用vnext(ASP.NET 5 RC1 Update1)在Mac中设置托管环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆