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

2

19

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?

Internecine answered 10/5, 2009 at 21:47 Comment(3)
I think it is ridiculous that there is no simple solution yet to this problem. You are not supposed to commit your .user files to a VCS either, so this problem scales to non-generated solutions.Entail
We fell back to using a please-run-me-after-checkout script. But like Alan BcBee's answer, it feels overly hacky. It makes the perfectionist in me a bit sad every time I see the file. Still hunting for a decent solution. :)Internecine
See change the working directory through VC++ property sheet.Sejm
D
8

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.

Deathday answered 25/8, 2010 at 18:54 Comment(1)
You may wish to clear values of fields like 'RemoteMachine' in this file before placing it in the repo.Santoyo
T
3

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.

Tharp answered 10/5, 2009 at 22:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.