fsprojects / fsprojects/Paket

Package targeting net8.0-windows7.0 does not get restored by msbuild

Open
#4,267 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
F#
Stars
2.1k
Forks
528
Avg merge
1d 12m
Merged PRs (30d)
54

Description

Description

I have a project that is targeting net8.0-windows and a package that only provides files for net8.0-windows7.0. When I build in Visual Studio everything works as expected, however when using msbuild v17 the package does not get restored and the build fails. This seems related to #4241 but not sure exactly.

We are using paket in magic mode, which resolves to 8.0.3 at this time.

Repro steps
  1. Create a winforms project that targets net8.0-windows and add WinForms.DataVisualization to paket.references
  2. Add some code that references that package, e.g. using System.Windows.Forms.DataVisualization.Charting;
  3. Confirm running .paket update followed by building in VS2022 works
  4. Commit the resulting paket.lock file and do a fresh clone
  5. Run msbuild /t:Restore /p:Configuration=Release followed by msbuild /p:Configuration=Release and the build will fail
Expected behavior

msbuild should succeed since the Visual Studio build works without issue.

Actual behavior

msbuild fails with the dependency not being included in the build, and the package is not present in obj/project.assets.json or obj/project.nuget.cache

Known workarounds

We added the .dll from the DataVisualization package to our repo and are linking to it directly instead of using paket.references. However this breaks the designer in VS2022 and so WinForms development is severely limited.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the fresh-clone reproduction using the committed paket.lock and the two msbuild commands. Compare the Visual Studio build with obj/project.assets.json and obj/project.nuget.cache after restore, focusing on why the net8.0-windows7.0 package files are absent. Done means msbuild restores the dependency and completes the build without the direct DLL workaround.

Written by the indexing model from the issue text.

Assessment

Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.