I'm planning on creating a few related C++ projects which will all have several settings in common (output path, exe naming convention, intermediate directory, ...) and I've managed to set most of the ones I need except the working directory:
It's set to $(ProjectDir) by default but I want that to be $(OutDir) instead and I was hoping to achieve this through a Property Sheet.
Unfortunately the property sheet itself (not the property pages of the project shown above) doesn't seem to contain a "Debugging" section:
Is it possible to override the Working Directory value using a property sheet in VS 2015 Community Edition (Update 3)?
You can open *. csproject file with any text or XML editor, change the wrong path, then save the file. Then re-open the project with Visual Studio again.
right click on the project that you want to add a . props file for and choose "Add Existing Property Sheet". You can also choose to add a new property sheet. I have my property sheet in the same folder as my solution file so that all my projects can use the same property sheet.
However, if you want to change or add a directory, it is better to use Property Manager to create a property sheet or modify the default user property sheet. For more information, see Share or reuse Visual Studio C++ project settings.
Select one of the properties in the VC++ Directories page. For example, choose Library Directories. Choose the down-arrow button at the end of the property value field. In the drop-down menu, choose Edit. You now see a dialog box like this:
To access the VC++ Directories property page: If the Solution Explorer window is not visible, then on the main menu choose View > Solution Explorer. Right-click on a project node (not the top-level solution) and choose Properties. In the left pane of the Property Pages dialog box, select Configuration Properties > VC++ Directories.
Use this property page to tell Visual Studio which directories to use when building the currently-selected project. To set directories for multiple projects in a solution, use a custom property sheet as described in Share or reuse Visual Studio C++ project settings. For the Linux version of this page, see VC++ Directories (Linux C++).
Apparently, these settings are normally stored in the foo.vcxproj.user
file (if changed from the defaults), but can be put in a property sheet instead. Putting this in your property sheet should do what you want:
<PropertyGroup Label="Debugging Properties">
<LocalDebuggerWorkingDirectory>$(OutDir)</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With