paket pack gives wrong framework version for nuget package
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
- Create a basic csproj project file for a classlibrary in a subfolder.
- Create a paket.template file beside it without any file listings
- Remove the
<TargetFramework>attribute from the cproj file and create a new directory.build.props file in folder above with the<TargetFrameworkVersion>property set. - Build project in release configuration
- 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.