views:

1175

answers:

4

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?

A: 

If the property is in the .user file, that's for a reason. The working directory is likely to be different from one user to the next.

John Saunders
Directories are almost always specified in a relative manner. And if they are, they can very well be shared. The working directory is not much different than the output directory, the additional include/library directories and the intermediate directory and all those are specified in the vcproj file.
mizipzor
In @mizipzor's case, it's implied that the working directory is not actually different from one user to the next (although it should be obvious why Microsoft had to assume it would be). However, I can't find any automation interfaces that change the debugger's working directory.
Alan McBee
To clarify, the working directory does indeed not differ between users. The program wants to load some assets, so it must be started from a certain directory. And those assets are version controlled, so relative to the checkout folder, we know where the exe should be placed after link. And also from where it should be run.
mizipzor
+2  A: 

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.

Alan McBee
A: 

Is there any way to bump this question? I have the same problem and would love someone to give the solution if it exists...

Edison Gustavo Muenz
No way to bump. But you can upvote the question, star it and cause general activity for it to get more attention. :) Im still looking for a good way myself. Although, this is not an answer, should have been a comment to the question itself.
mizipzor
A: 

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

Project_Name.Domain.user_name.user

Change it to: Project_Name.user and commit.

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

ScottyR