Вопрос

We're using visual studio 2005. I know, but it's what we have.

So, we have a project folder, plus some "other" code in another folder. The other code is from other groups and is read-only. Since we're using clearcase, this other code area is subject to change. Without going into a lot of boring detail (I still don't "get" clearcase myself so please don't ask), what we normally do is map the view of this other drive to a fixed drive letter using subst.

I'd like to get away from that and use one environment variable to reference that other code drive.

I defined an environment variable 'blah', pointing to the drive and path of this other code. I've got the solution files fixed up by simply referencing the env variable %blah%. My trouble is trying to get the project (vcproj) files to similarly behave when reference files from that other code area.

Within the vcproj file, I've tried:

< File RelativePath="%blah%..."

and

< File RelativePath="$(blah)..."

Neither work - I receive an error when I try to open the file:

u:\path\to\vcprojfile\$(blah)...\myfile.c Cannot open file.

Before I modified the vcproj file, the RelativePath attribute contained the absolute path to the file. So, why is the environment variable not being properly expanded? Can I even do what I want to do here?

Это было полезно?

Решение

Try to use UPPER CASE for your environment variable, and for the file's relative path. Use RelativePath="$(BLAH)\Folder\myfile.c" syntax. It works for me in VS2005.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top