Paket pack cannot ignore framework subdirectory
Description
Running paket pack on an SDK style project that builds without the TargetFramework subdirectory will not find the assembly.
Using AppendTargetFrameworkToOutputPath set to false or specifying OutDir instead of OutputPath results in building the assemblies into the top ${OutputPath}\ instead of the framework subdirectory as ${OutputPath}\${TargetFramework}\.
Either setting is ignored by paket and it tries looking up the assembly in the ${OutputPath}\${TargetFramework}\ folder where it is not.
Repro steps
-
Create a project with any of the two csproj properties (set
AppendTargetFrameworkToOutputPathtofalseor specify theOutDir). -
Try running paket pack on the project.
Expected behavior
Paket finds the assembly in the directory as per where it is configured to build.
Actual behavior
Paked looks for the assembly in the directory the assemlby would be if neither of the two property would be configured.
Known workarounds
Dotnet pack can be used instead on the project but that leads to a lot of extra effort and new issues when other projects are packed with paket in the same solution.
Duplication
Please note that a narrower range of this issue (mentioning only the AppendTargetFrameworkToOutputPath property) has been raised 2 years ago on issue #3971.
@forki could you take a look on this, thats really a showstopper for Paket and net 6.0 for us, since our CI pipeline requires to put all output assemblies into the same out folder.
could you please prepare the repro so that I just have to run that paket pack call? Sorry I'm very low on time at the moment, but I would then try to look at it this evening
this should do it: https://github.com/legrab/paket_4157
Referred method: https://github.com/fsprojects/Paket/blob/80d1c2cd598d6e891a958801533ae7fc6a3a6309/src/Paket.Core/PaketConfigFiles/ProjectFile.fs#L1638-#L1659
#L1642 handles 'AppendTargetFrameworkToOutputPath' property, but that works with the hard-coded 'bin' pre-directory, so that clearly is not the generic case.
'framework' sub-dir is added to the path disregarding the property on #L1659.
@Koala06 looks like you are very close. - care to send a PR?
The suggested Pull Requests have been merged and released in 7.2.0, so I am closing this issue