Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can the working directory be set in the project (.vcproj) file?

I have a script that generates a .sln file and a few .vcproj files for visual studio 2005. I need to set the WorkingDirectory option but its specified in the .user file. A file we cannot currently generate. I found the vcproj file definition at msdn, but it seems that this option cant be set from there.

How does one specify "Configuration Properties->Debugging->Working Directory" from the .sln or .vcproj file?

like image 672
Mizipzor Avatar asked May 10 '09 21:05

Mizipzor


People also ask

How do I change the working directory in Visual Studio?

In Visual Studio 2010: Go to the project properties (rigth click on the project name in the Solution Explorer, then Properties on the pop up menu). Then, under Configuration Properties / Debugging, set Working Directory to $(SolutionDir)$(Configuration)\ .

Where is the Visual Studio working directory?

Open Project -> Properties -> Configuration Properties -> Debugging . The working directory entry is $(ProjectDir) by default.


2 Answers

After you change your settings, and close the sln you will get a user file named something like:

Project_Name.vcproj.Domain.user_name.user

Change it to: Project_Name.vcproj.user and commit.

The next person who checks out the code will use this user file to create their user specific one.

like image 194
ScottyR Avatar answered Oct 05 '22 09:10

ScottyR


Change from my comment. I did find the property:

VCDebugSettings.WorkingDirectory

Use Visual Studio Extensibility to create an add-in or macro that calls this method. You should be able to hook into a BeforeCompile event or something to set it.

Not an easy answer, but doable.

like image 23
Alan McBee Avatar answered Oct 05 '22 09:10

Alan McBee