如何在 Visual Studio 2008 下分析应用程序时为我的应用程序设置环境变量 [英] How do I set Environmental variable for my application while profiling it under visual studio 2008
问题描述
我有一个申请.我使用vs2008团队系统编译它.要运行此应用程序,需要设置一些特定的环境变量,例如 SYSTEM_MODULE_PATH.我的应用程序从那里加载系统模块.没有这个变量,它就不会运行.所以当我分析它时,我想设置这个变量,以便我的应用程序正常运行.
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?
推荐答案
我在询问时修复了它.但是没有分享.这就是我所做的.
I fixed it when I asked it. But didn't shared. Here is what I did.
我创建了一个批处理 (.cmd) 文件.我在那里设置了我的环境变量.然后使用 devenv
命令启动 Visual Studio.这是示例批处理文件
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
现在 Visual Studio 打开并加载一些 ENV 变量.
Now Visual Studio opens with some ENV variable loaded.
这篇关于如何在 Visual Studio 2008 下分析应用程序时为我的应用程序设置环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!