-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Self-contained apps should include RID fallback graph in .deps.json #3361
Comments
Can we consider doing this in the 3.0/3.1 timeframe? See https://github.com/dotnet/coreclr/issues/25516 which is a customer hitting this issue. |
The RID graph generation for Ideally we would share the code somehow between SDK and the tools in core-setup, but the amount of code which does this is relatively small, so maybe just a copy would work as well. |
In order to support loading components with RID-specific assets, the AssemblyDependencyResolver requires a RID fallback graph. The component itself should not carry the RID fallback graph with it (it would need to have the graph of all the RIDs there are and it would need to be updated with every addition). For framework dependent apps, the RID fallback graph comes from the core framework Microsoft.NETCore.App, so there is no need to write it into the app. If self-contained apps, the (applicable subset of) RID fallback graph needs to be written to the deps.json manifest. Fixes dotnet#3361
…0191029.2 (dotnet#3361) - Microsoft.NETCore.App.Ref - 3.1.0-preview2.19529.2 - Microsoft.NETCore.App.Runtime.win-x64 - 3.1.0-preview2.19529.2 Dependency coherency updates - Microsoft.NET.Sdk.WindowsDesktop - 3.1.0-preview2.19529.5 (parent: Microsoft.NETCore.App.Runtime.win-x64)
With the introduction of
AssemblyDependencyResolver
in 3.0 we're making it relatively easy to dynamically load components with their entire dependency trees. Such components can be portable in the sense that they include RID specific assets (for example different asset for Windows and Linux).In order to correctly resolve dependencies of such component, the
AssemblyDependencyResolver
must have a RID fallback graph to follow (so that when we're running onwin10-x64
, we know that we should also look for assets which arewin-x64
or evenwin
). The component itself should not carry the RID fallback graph with it (it would need to have the graph of all the RIDs there are and it would need to be updated with every addition).Just like framework dependent apps which rely on the framework to provide the RID fallback graph, the component should rely on the host app to provide the RID fallback graph.
So if the host app is a framework dependent app, the RID fallback graph comes from the core framework
Microsoft.NETCore.App
. In this case everything works fine.If the host app is a self-contained app, it in itself doesn't need a RID fallback graph since it's been built/published for one specific RID and thus it only carries assets which are necessary for that RID. But if a portable component is about to be loaded into such app, the RID fallback graph is necessary.
The proposal is to modify the SDK to include the RID fallback graph in self-contained app's
.deps.json
. It should be the graph filtered by the RID the app is targeting (just like what we do for the shared framework).The problem is also discussed in https://github.com/dotnet/core-setup/issues/6960
The text was updated successfully, but these errors were encountered: