4
votes

Is there a way to get a VS project to build the debug EXE to a directory other than bin/debug?

I found this: http://msdn.microsoft.com/en-us/library/ms165410%28v=vs.80%29.aspx

However, that is only for the RELEASE not for debug.

UPDATE:

I failed to mention this is for the Express version, not the full version.

For anyone else who wants to do the same, here is how:

  • Open your '.csproj' file.
  • Find an element 'PropertyGroup' which defines the debug building process.
  • Then, inside you will find another element called 'OutputPath'. Just change the value of its text to the directory you want your debug output to go to.
2
What do you mean "not for debug"? - Alexei Levenkov
You can 'f5' which builds for debug, or you can ctrl+b which builds the release. When I hit 'f5', I would like the EXE to be compiled to a directory other than bin/debug. - Lee Loftiss
I changed it to say RELEASE so it is clearer. Thanks Alexei. - Lee Loftiss
Than change settings for DEBUG configuration... Also I'm not sure if Express editions have the choice of configuration if you use it... but even than you can simply edit .csproj file any way you like... - Alexei Levenkov
Thanks Alexei. That did the trick. - Lee Loftiss

2 Answers

4
votes

To change the build output directory:

On the Project menu, click Properties.
Click the Build tab.
Click the Browse button next to the Output path box and select a new build output directory.

MSDN :Change Build output directory

Change debug directory.

0
votes

The Output path is stored in the .cproj file. One for each configuration.

Open ur *project_Name.csproj* in any editor (say notepad)

For Debug:

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    .....
    <OutputPath>myOutput\</OutputPath>

</PropertyGroup>

Similarly For Release:

 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    ...
     <OutputPath>bin\Release\</OutputPath>
</PropertyGroup>

You could try manually editing the OutputPath.

The Output Path can take both Relative and Absolute paths.

Note: The Relative OutputPath should be relative to your project directory (project_Name.csproj) .