Package targeting net8.0-windows7.0 does not get restored by msbuild
Nobody has claimed this yet.
- 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
- Create a winforms project that targets net8.0-windows and add WinForms.DataVisualization to paket.references
- Add some code that references that package, e.g.
using System.Windows.Forms.DataVisualization.Charting; - Confirm running
.paket updatefollowed by building in VS2022 works - Commit the resulting paket.lock file and do a fresh clone
- Run
msbuild /t:Restore /p:Configuration=Releasefollowed bymsbuild /p:Configuration=Releaseand 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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