Home > database >  How to make VS2019 not create folder 'net5.0' for building project?
How to make VS2019 not create folder 'net5.0' for building project?

Time:11-02

I'm created a solution (with 1 project) in VS 2019 with TargetFramework .NET 5.0 (NET Core). I set OutputPath (in Properties of Project) to 'bin\SomeMyFolder' and expected that all my output files will be there. But it turns out that inside folder 'SomeMyFolder' lays other folder 'net5.0' and my files are inside it. I have never seen such custom folders, created by VS previously, with other .Net Framework version. Is there any way to disable VS 2019 from creating that folder and build my project in that folder, which I set (right into SomeMyFolder)? P.S: Please, do not advise some scrips on post-build event like 'copy SomeMyFolder\net5.0 -> SomeMyFolder | rmdir SomeMyFolder'

CodePudding user response:

This can be disabled in your csproj file by adding a propertygroup like this.

<PropertyGroup>
  <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>

More info: https://docs.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#appendtargetframeworktooutputpath

  • Related