Paket icon indicating copy to clipboard operation
Paket copied to clipboard

paket pack gives wrong framework version for nuget package

Open epaulsen opened this issue 4 years ago • 0 comments

Description

We are in the process of moving an old legacy WPF application to a newer framework version, and in order to make the upgrade more smooth we moved a lot of common properties from the different project files into a separate directory.build.props file, including the <TargetFrameworkVersion> property. If TargetFrameworkVersion is found in the csproj file, paket will output with correct framework version, the assemblies are put in lib\net472 inside the nuget package. After TargetFrameworkVersion property is moved to a separate file, nuget packages built will put assemblies in lib\net40 folder inside nuget package.

Repro steps

  1. Create a basic csproj project file for a classlibrary in a subfolder.
  2. Create a paket.template file beside it without any file listings
  3. Remove the <TargetFramework> attribute from the cproj file and create a new directory.build.props file in folder above with the <TargetFrameworkVersion> property set.
  4. Build project in release configuration
  5. Run paket pack nugets

A sample project with these steps taken is attached here Repro.zip

Expected behavior

Paket should produce a nuget package with assemblies placed in lib\net472 folder.

Actual behavior

Paket produces a nuget package with assemblies placed in lib\net40

Known workarounds

None known.

epaulsen avatar Aug 17 '21 06:08 epaulsen