-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
MetadataLoadContext to support dynamic assemblies #27803
Comments
Moving to future. |
There have been no customer asks for this so far, although the scenario is valid. Due to 5.0 schedule constraints, this is being moved to Future. |
I would really like support for this 🙂. I want to load some dynamic assemblies that are built in memory with S.R.Emit, and then load them into MetadataLoadContext for unit testing my load context reflection logic. |
Per offline discussion, the scenario for "dynamic assemblies" can be scoped to being able to use MLC to inspect a single-file app which contains embedded assemblies as resource blobs. To support this there are two general options:
Exposing an a Some prototype thoughts:
I assume this means an addition to or a replacement for the path-based resolver that we already have to help with dynamically produced assemblies referencing each other without physical files?
Note that |
Moving to future based on priority + schedule. Currently there are no community asks for this. @vitek-karas do you have thoughts on enabling MLC to work on single-file apps? |
I must admit that I don't understand how "dynamic assemblies" relate to single-file, other than both don't have a backing file. So far we've been trying to avoid introducing APIs to read from the single-file. The main reason being that there are effectively 3 or 4 implementations of single-file already and each is likely to behave differently:
On top of that there are full AOT scenarios (NativeAOT, WASM AOT, Android AOT, iOS AOT) where there's no IL to begin with. On top of that, we're hesitant to allow access to the bundle parts as that would directly lead to requests to allow bundling of random content/data files and access to those - which would effectively create another API to access data alongside of existing File APIs and ResourceManager APIs. And more importantly we're trying to get to a place where well written code would work in single-file or multi-file deployments without changes. To that end the
It would still not solve full AOT support - but that is likely never going to work. |
If we implement AssemblyBuilder.Save() it would be possible to load those into MLC. |
As part of the review for feature #15033 and PR dotnet/corefx#33201, there was concern about the lack of support for assemblies not backed by a physical file.
From the comments @jkotas:
Implementation\design TBD. One approach is to use runtime reflection over the dynamic assembly, and convert those from
System.RuntimeType
to the MetadataLoadContext types (System.RoType
).The text was updated successfully, but these errors were encountered: