Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
DanJensen opened this issue Jan 5, 2024 · 0 comments

Comments

@DanJensen
Copy link

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. :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant