-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
AssemblyLoadContext documentation #6016
Comments
cc @gkhanna79 |
https://blogs.msdn.microsoft.com/dotnet/2016/05/27/making-it-easier-to-port-to-net-core/#comment-77765 has some frequently asked questions that this documentation should provide answers to. |
Sounds good @jkotas I will look into this next week. |
On the blog at the link above you write : "AssemblyLoadContext does not provide data isolation. Objects can be passed between them without" .. but is this not then inconsistent with having separate static variables per context ? Essentially I want parallelism with a very low dependency on having to write thread-aware code. Appdomains gave that to me. |
I am not sure where you see the inconsistency. For both AppDomain and AssemblyLoadContext, the code that sets up your computation has to be thread-aware. |
Hi, |
@Ninds Your example makes sense. It should be possible to build this with AssemblyLoadContext. |
ah great. so isolated static variables in each context ? So will we be getting some doc on this feature soon ? |
.. one more thing will exceptions propagate across context boundaries ? |
Correct.
@gkhanna79 is going to start working on the docs soon.
It is in our backlog - we do not have the date for it.
Yes. |
That's GREAT ! |
Hi I'd like to chime in with a couple of other AssemblyLoadContext questions. (I'm told this is the place to ask them so they'll be addressed in the documentation - apologies if this isn't the right place.)
The scenario I'm interested in is a long-running server that compiles and loads some source code (and runs it etc.) but can unload it and recompile and reload a new instance of it if the source code is changed. Looking at the current source code for AssemblyLoadContext (https://github.com/dotnet/coreclr/blob/d2f9a4dd588a1a9e6349c8bc4f0694e0d1130ab6/src/mscorlib/src/System/Runtime/Loader/AssemblyLoadContext.cs) I'm not sure if this is even possible - a comment in the source code says 'Since unloading an AssemblyLoadContext is not yet implemented...' Even if it's not possible, it'd be great if the docs could state that it wasn't possible. There's not a lot of info around for AssemblyLoadContext and some of it is contradictory. Also, if it's not possible, how does Kestrel do this? I struggled finding that bit in Kestrel's source code so if you've any pointers I'd appreciate them. Many thanks! |
Correct - the runtime/ALC implementation does not support it. I have been a little behind in the doc but will ensure it is called out there as well. I am not sure about Kestrel - can you point me to it? |
Hi, Thanks for that. Kestrel's just the default web server when I do dotnetcore+MVC development on OS X, and I think it recompiles and reloads pages when they change which is sortof what I'm aiming for. The code starts at: https://github.com/aspnet/KestrelHttpServer but it may be part of MVC that does the reloading. Many thanks - I look forward to reading the docs when they're available! |
Kestrel doesn't unload anything. MVC (which sits on top) has a view engine (Razor) that compiles views on the fly. https://github.com/aspnet/Mvc/blob/7ce344270a63f6cb397c1ef9829e5c54e7c171ed/src/Microsoft.AspNetCore.Mvc.Razor/Internal/DefaultRoslynCompilationService.cs#L183 No magic 😄 |
Ah well - I was kinda hoping for some magic here! Many thanks. |
Hi, Rgds |
Any updates on this? Trying to do some work in this area and can't find a lot of documentation on it. |
Hi , |
@jkotas @gkhanna79 I'm currently trying to implement AppDomain-like functionality using AssemblyLoadContext and would really appreciate some documentation on it. Specifically, it would really help to know:
|
Also, it appears that Assembly.LoadFromStream doesn't support netmodules. Is there any other way to load a netmodule from a |
.NET Core as a whole does not support netmodules. |
Please see dotnet/coreclr#10271 |
@gkhanna79 This is great, thanks! |
When I search Bing for AssemblyLoadContext documentation, it leads me to this page. I read through the whole post looking for a link to some documentation, maybe I missed it. Anyway, without a search engine I found this page: Can anyone please confirm if that's the documentation you've been referring to? Is it the total of all documentation produced on AssemblyLoadContext since June 2016? @gkhanna79 do you have another link to the real documentation? Thanks. |
@ro-jo The Pull Request referenced by @gkhanna79 created this document. Did you look at that? |
@svick err... nope, but thanks. Might have seen it briefly in my search and skipped over it, since it doesn't use the term 'AssemblyLoadContext' ubiquitously. Hardly at all actually. I wouldn't have thought it was describing AssemblyLoadContext if you hadn't told me. |
There are a lot of questions being asked on how this works - we need to have documentation for it.
The text was updated successfully, but these errors were encountered: