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

.deps.json for desktop app is not including any nuget package references (VS2022 17.3.0 Preview 3.0) #46247

Open
rickbrew opened this issue Jan 23, 2025 · 11 comments
Labels
Area-CLI untriaged Request triage from a team member

Comments

@rickbrew
Copy link

This might be related to, or a duplicate of, #45686. Please let me know which log files, or whatever, you need. I can also provide access to a GitHub repo with the whole solution. I was told (@tannergooding) on Discord that this is probably an SDK issue.

In VS 2022 17.2.4 ("latest public stable"), my app builds and runs fine.

In VS 2022 17.3.0 Preview 2.1, it also worked fine.

In VS 2022 17.3.0 Preview 3.0, which I installed yesterday, it's completely broken. When the app launches, it throws a FileNotFoundException for TerraFX.Interop.Windows, despite the file being present and the working directory (via Environment.CurrentDirectory) being correct (the same dir as the exe, its DLL dependencies, etc.).

If I roll back to VS 2022 17.3.0 Preview 2.1, it works fine. If I then update to Preview 3.0, it again does not work.

This screenshot is just inside my Main method:
Image

In the .deps.json, all of the nuget package references are missing:

paintdotnet.deps.VS2022.17.12.4.Works.json
paintdotnet.deps.VS2022.17.13.0.Preview.3.0.Broken.json

Here's a screenshot showing some of the diff between the working and broken ones. The only difference I can tell between these two .deps.json files is that the "broken" one is missing all of the nuget packages:

Image

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-CLI untriaged Request triage from a team member labels Jan 23, 2025
@rickbrew
Copy link
Author

Note that I am not currently blocked by this because I can use the non-Preview build of VS just fine. This would of course be an adoption blocker for 17.3 for me.

@baronfel
Copy link
Member

@nagilson is this related to the deps.json PR we have been talking about this week?

@baronfel
Copy link
Member

@rickbrew are the dependencies in question marked PrivateAssets="all" by any chance?

@rickbrew
Copy link
Author

@rickbrew are the dependencies in question marked PrivateAssets="all" by any chance?

Yes.

@baronfel
Copy link
Member

OK, so I think this is the same problem as dotnet/roslyn#76797, which we have a revert for pending at #46182. We're trying to get this into the 200 release now. The correct plan is likely #46218.

@rickbrew
Copy link
Author

I'm not actually sure that PrivateAssets="all" is accomplishing what I need/expect anyway. The app supports plugins, and it's been difficult to make sure that the "private" DLLs for the app (things like TerraFX.Interop.Windows) are not swept into the plugin's dependencies as well. If there's newer guidance for handling this, I'm all ears.

@rickbrew
Copy link
Author

OK, so I think this is the same problem as dotnet/roslyn#76797, which we have a revert for pending at #46182. We're trying to get this into the 200 release now. The correct plan is likely #46218.

If you'd like an additional VS solution to validate this with, I can provide access to dotnet/paint.net. It's a mirror of my private repo for MSFT employees for just this sort of thing.

@baronfel
Copy link
Member

A bunch of us have been looking at this problem for the .NET SDK, MSBuild, Azure Functions, and all kinds of plugin hosts in general. @ericstj has been driving some of the thinking for that. Once we have some concrete proposals I'd love to get your feedback on them!

@nagilson
Copy link
Member

@nagilson is this related to the deps.json PR we have been talking about this week?

I'm not super in-touch with that conversation, but it seems like yes and you also already determined that. @Forgind would be better to answer that question definitively.

@ericstj
Copy link
Member

ericstj commented Jan 23, 2025

I'm not actually sure that PrivateAssets="all" is accomplishing what I need/expect anyway. The app supports plugins, and it's been difficult to make sure that the "private" DLLs for the app (things like TerraFX.Interop.Windows) are not swept into the plugin's dependencies as well. If there's newer guidance for handling this, I'm all ears.

Exactly - it's very difficult to control. You can try using ExcludeAssets and PrivateAssets, but it doesn't compose well with other libraries referencing the same packages, nor with CPM, nor with the generated deps file. I've been trying to propose a new way to do this.

I have a very hacky manual "targeting pack" demo that requires a lot of work for the host - building a host package, redistributing dependencies. I would much prefer if we had a feature in nuget that could allow a gesture on a single package reference.

I might have a look at paint.net to see how it manages plugins. Looks like I have access to that repo. Which components should I look to for seeing the app-model for plugins?

@rickbrew
Copy link
Author

I might have a look at paint.net to see how it manages plugins. Looks like I have access to that repo. Which components should I look to for seeing the app-model for plugins?

I created a discussion thread over on dotnet/paint.net, https://github.com/dotnet/paint.net/discussions/42, so we can go into detail over there. @baronfel if you'd like to participate or just listen in, let me know and I'll make sure you've got access too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-CLI untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

4 participants