fsprojects / fsprojects/Paket

Visual studio not restoring packages for projects that target net8.0-windows

Open
#4,241 0 comments 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'm working on upgrading a net6 product suite (which uses paket) to net8. Some of the projects are Windows UI applications, and as such they target net6.0-windows. Everything works fine targeting net6. However, when upgrading to net8, something is causing VS 2022 to no longer restore any packages in projects that target net8.0-windows. The net8.0 projects work fine. And ALL projects work if I run a build from the command line using dotnet.exe. So the problem is specific to VS when combined with net8.0-windows projects.

Repro steps

I have multiple projects that target net8.0, and multiple that target net8.0-windows. The behavior described above is consistent in all of them, and it doesn't matter which nuget packages I'm referencing. In VS, net8.0 projects work, but net8.0-windows projects do not. And everything works from the command line. I should also add that "dotnet paket restore" does bring everything down into the packages folder as expected.

Just to be clear, my paket.dependencies file does have groups defined. One has a restriction of net8.0 and one has a restriction of net8.0-windows. I know I'm using the correct groups in the various paket.references files because: 1) The same groups worked fine for net6; and 2) It works fine for net8 if I build it from the command line with dotnet.exe.

Also, I'm using paket v8.0.0. I'm using that same paket version with the net6 codebase and it's fine.

Expected behavior

Packages should be restored to the projects in VS Solution Explorer and builds should work within VS.

Actual behavior

There is no "Packages" node listed under the Dependencies section for the net8.0-windows projects in VS Solution Explorer. And of course, builds fail because it doesn't recognize the referenced objects.

Known workarounds

I'd love to find one. :(

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 by reproducing the issue in Visual Studio with the reported net8.0 and net8.0-windows projects, then compare that behavior with dotnet restore and paket restore. Trace Paket's Visual Studio project integration and package-reference generation; done means Windows-targeting projects show their Packages dependencies and build successfully in Visual Studio.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.