output path ignored with .net 5 C# classes lib

Pasc059 1 Reputation point
2020-12-17T16:47:09.117+00:00

Hello,

I updated a .net framwework project (a library of windows forms controls in C#) to .net 5. Eveything seems ok except that the ouput path of the buid, specified in the project properties, is ignored. For instance, for the Debug config the ouput path is always 'bin\Debug\net5.0-windows' and 'bin\Release\net5.0-windows' for the Release config. I don't want vs2019ce (version 16.8.3) add/create the folder 'net5.0-windows'.

Is this a bug?

regards

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,823 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Oleg Ra 1 Reputation point
    2020-12-18T06:15:58.447+00:00

    @Pasc059 If you use the new .csproj format (and most probably you do so) just add these lines into the project file:

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

    See more details here (in the Note section).


  2. Pasc059 1 Reputation point
    2020-12-18T08:35:13.917+00:00

    Hi,
    thank you Oleg, after inserting the lines you mentioned in the csproj file, this works as i want. Without specifying an output path, the defaults outputs are \bin\Debug and [bin\Release for respectively the Debug and Release configurations, which suits to me.

    Regards
    Pascal

    0 comments No comments