开发者

How to add existing project using environment variable?

I have a a project that resides on a "thumb drive" (a.k.a. memory stick). Due to Windows ability to change drive letters of thumb drives, I would like to specify the location of sub-projects using an environment variable. This allows me to set the thumb drive drive letter, depending on the PC that I am using; or change the variable when the drive letter changes (such as happens when adding a hard drive to the PC).

This issue has sub parts:

  1. How do I tell Visual Studio (2008) to use environment variable when adding an existing project using the GUI?

  2. Which files do I nee开发者_Python百科d to modify with the environment variable (*.dcp, *.vcproj, *.sln)?

  3. Do I need to delete the platform specific vcproj files, such as *.vcproj.host_name?

    {Since I use different host PCs with the thumb drive, there are different vcproj files.}

I am using MS Visual Studio 2008, C++, on Vista and Windows XP (at least two platforms).


The best solution here is to use relative paths for your subprojects. The relative path from your solution file to the subprojects does not change, as both are on the same thumb drive.


You can also overcome the wandering drivename by using the 'subst' command.

for instance

f(thumbdrive):\>  subst z: projectfolder

and then you can always access your folder at z:\, presuming none of the computers have a 'z:' drive installed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜