-
Notifications
You must be signed in to change notification settings - Fork 256
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
Automatically download targeting or runtime packs from transitive FrameworkReferences #9937
Comments
What if NuGet had some kind of One of the things that makes NuGet's package lock files so problematic is that the restore graph changes when doing things like changing the RID. I don't like the idea of even more restore-time complexity. Although the problem with this idea is that not all package downloading happens at restore time. Some could get downloaded at other times, like publish. Or if customers discover that NuGet has this task, they might start using it in uncontrollable places in custom targets. |
Can you please let us know the expected customer impact on this issue, so we can reassess priority? Should we discuss it in our weekly meeting? Ref: https://github.com/dsplaisted/ReferenceAssemblyPackages |
Consumers of Maui essentials packages must set
|
Team Triage: We need to discuss this in more detail with @dsplaisted |
Isn't it what new dotnet workloads are for? It would make sense to install new "windows workload" to be able to edit and build net6-win projects on the machine. Though I am not against of automatic downloading. |
Currently, the .NET SDK will download targeting and runtime packs for all shared frameworks it knows about. For example, for a self-contained console app where the targeting packs aren't installed, it will download targeting and runtime packs for Microsoft.AspNetCore.App and Microsoft.WindowsDesktop.App, even if those frameworks aren't used at all in the app. This is because when the SDK is generating the
PackageDownload
items for targeting and runtime packs, it does not know if those frameworks will be required via a transitive package or project dependency. So it has to download them in case they are needed.In order to avoid these (usually unnecessary downloads), we would need additional logic in NuGet. It could work like this:
The SDK would pass additional data to NuGet restore, in the form of a map from framework reference to a list of packages to download. For example:
When walking the graph, if NuGet encountered a package or a project that with a framework reference dependency, then NuGet would download the packages specified in the map. Those packages would be treated essentially as additional
PackageDownload
items.This would mean that instead of preemptively downloading all of the possible targeting and runtime packs, the SDK could pass the information to NuGet that would allow only those that were needed to be downloaded.
The text was updated successfully, but these errors were encountered: