LTR
LTR

Reputation: 1352

Disable append Configuration Name to Output Folder in vcproj

In a C# csproj project, AppendTargetFrameworkToOutputPath and AppendRuntimeIdentifierToOutputPath prevent msbuild from creating subfolders for target framework and runtime in the build output directory. However, the configuration name is still appended.

Is there a configuration option to prevent a separate subfolder for each configuration?

Upvotes: 1

Views: 933

Answers (1)

Wexos
Wexos

Reputation: 71

So I figured out a solution to this. When editing the project settings in Visual Studio, it modifies the <BaseOutputPath> element in the XML project file. Simply change the element name to <OutputPath> instead, and it won't append the configuration name (and as you said, add <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath> and <AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath> to disable appending target framework and runtime identifier).

As an example, I have the following in a <PropertyGroup> in a C# project:

<OutputPath>$(SolutionDir)Build\$(Configuration)\Plugins</OutputPath> 
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>

For a debug build, this will output the build files to <SolutionDir>\Build\Debug\Plugins.

Upvotes: 2

Related Questions