In traditional .NET applications, it was possible to set a custom <OutputPath>
of an assembly in the .csproj
file (or via the project properties dialog). A path of e.g. bin\$(Configuration)\$(Platform)
resulted in bin\Debug\AnyCPU
.
I had the habit of setting those values independent of the current build configuration (in its own ItemGroup
, together with DocumentationFile
, etc).
When I'm setting up my configuration in the new .NET core .csproj
like this...
<OutputPath>bin\$(Configuration)\$(Platform)</OutputPath> <DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
..the following folder structure gets created:
bin\ Debug\ AnyCPU\ MyAssembly.xml netstandard1.0\ MyAssembly.exe
So it seems msbuild, or whatever automatically appends the TargetFramework
, which is rather annoying.
Is there a way to truly customize the output path or disable this behavior?
You can disable this behaviour by setting:
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
This behaviour originates from the Microsoft.NET.Sdk
(see its source)
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