Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Store Visual Studio's Debug Configuration in Source Control

Visual Studio's debug configurations are stored in the .user file which is user specific and traditionally ignored by source control.

I am interested in the working directory parameter. I need it to be consistent across programmer's machines and it have the value of $outDir instead of the default $ProjectDir.

How can I resolve these contradictions?

like image 861
Artium Avatar asked Dec 11 '22 16:12

Artium


1 Answers

Add this to the end of the vcxproj before the </project> tag:

  <PropertyGroup>
    <LocalDebuggerWorkingDirectory>c:\same\for\everyone</LocalDebuggerWorkingDirectory>
  </PropertyGroup>

I just checked it on 2010.

Visual studio will still show $(ProjectDir) in the IDE because I guess it populates it with whatever it finds in the .user file, but during building tasks it seems to process the .user file after the vcxproj; without an override in the .user it seems to accept what's set in the vcxproj.

Note that if you put this at the end of the vcxproj as I suggested, it is necessarily after the import of Microsoft.Cpp.props which is all that's important as @Claytorpedo points out

like image 170
zeromus Avatar answered Apr 29 '23 10:04

zeromus