How do I set Environmental variable for my application while profiling it under visual studio 2008

会有一股神秘感。 提交于 2019-12-12 16:13:22

问题


I have an application. I compile it using vs2008 team system. To run this app some certain environmental variables need to be set, such as SYSTEM_MODULE_PATH. My app loads system modules from there. Without this variable it wont run. So When I profile it, I want to set this variable so that my application runs properly.

Now my question is, Where do I set this variable?


回答1:


Start -> Control Panel -> System -> advanced Tab -> Environment variables

or CMD -> SET [variable=[string]]




回答2:


I fixed it when I asked it. But didn't shared. Here is what I did.

I created a batch (.cmd) file. I set up my environment variable there. Then started Visual Studio using devenv command. Here is the sample batch file

rem Sample Environment loader for VS
SET ENV_VAR1=Value1
SET ENV_VAR2=Value2
SET ENV_VAR3=Value3
devenv \path\to\solution\file

Now Visual Studio opens with some ENV variable loaded.



来源:https://stackoverflow.com/questions/3205672/how-do-i-set-environmental-variable-for-my-application-while-profiling-it-under

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!