Can the working directory be set in the project (.vcproj) file?
-
21-08-2019 - |
Question
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?
Solution
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.
OTHER TIPS
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.