Visual Studio 属性页环境变量
如果您右键单击解决方案资源管理器中的项目并转到常规 ->调试中有一个环境部分,您应该能够使用语法 NAME=VALUE 设置环境变量。我的问题是,如果我尝试在那里创建一个新的环境变量,它似乎实际上不起作用或无法设置。有人有这方面的经验吗?我只想设置一个环境变量,以便我可以在自定义构建步骤中使用它,如下所示:
环境变量
LANGUAGE_VAR=en_us
自定义构建步骤
copy $(InputPath) $(outDir)\%LANGUAGE_VAR%\$(InputFileName)
类似的东西。 这个 MSDN 页面很有用,但我无法让它工作: http://msdn.microsoft.com/en-us/library/ms173406 .aspx#1
If you right click on a project in solution explorer and go to General -> Debugging there is an Environment section where you should be able to set environment variables using the syntax NAME=VALUE. My problem is that if I try to create a new environment variable there it doesn't seem to actually work or get set. Does anyone have any experience with this? I just want to set an environment variable so I can use it in custom build steps like this:
environment variable
LANGUAGE_VAR=en_us
custom build step
copy $(InputPath) $(outDir)\%LANGUAGE_VAR%\$(InputFileName)
Something similar to that.
This MSDN page is useful but I can't get it to work:
http://msdn.microsoft.com/en-us/library/ms173406.aspx#1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实上,我发现对我非常有帮助的是物业经理 -> 。选择我所有项目继承的属性页->双击打开属性页编辑器->单击用户宏->添加宏并定义其名称和值。
现在,在我的自定义构建步骤中,我可以引用该宏。
因此,如果我的宏是 LANGUAGE=en_us,我可以运行构建并构建出我想要的所有 en_us 内容。如果我返回属性管理器并将 LANGUAGE 的值更改为 es_es,那么我可以运行构建,并且我的构建步骤将获得 es_es 而不是 en_us。我希望这不会太令人困惑。如果您遇到这个问题并且不知道我在说什么,请PM我。
Actually what I found that was very helpful to me was going to Property Manager -> Select the property pages that all my projects inherit -> Double click to open the property pages editor -> Click User Macros -> Add a macro and define it's NAME and VALUE.
Now in my custom build steps I can refer to that macro.
So if my macro was LANGUAGE=en_us I can run a build and build out all the en_us stuff I want. If I go back to Property Manager and change the value of LANGUAGE to es_es then I can run a build and my build steps will get es_es instead of en_us. I hope that isn't too confusing. PM me if you have this problem and don't know what I'm talking about.