-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
Is there a way to dynamicaly load dependencies?(For plugin system) #252
Comments
With things like the Managed Extensibility Framework you should be able to create a dynamic plugin system already. |
Im talking about something like scanning folders and loading assemblies with Assembly.Load, which is not available when I target CoreClr. So I assume there will be some hooks or api for loading dependencies from other folders and locations from code. Btw is MEF ported to CoreClr? |
@aanufriyev i suggest checking Autofac, it does what you need and have support in VNext |
@devmondo CoreClr or Clr support? If I use full Clr I have no problems, because there is Assembly.Load. Question was about CoreClr. I have seen some stuff in IAssemblyLoadContext, but it was changed recently and dunno whre it is going to. |
@aanufriyev i you maybe right about coreclr but i read this article and it seams the solution works for both full and core by using #if statement in the code. |
@devmondo this article states that Autofac is not available for core dotnet) Code dependencies are not a problem. I can't find a way to load k dependencies. |
@aanufriyev maybe you are right, but this article is old, and there has been many changes to VNext dependency of injection, and there will be more i think, so i suggest you upgrade latest Packages and KRE and try the example above, it may work. and i have same case as yours, and as i mentioned before AutoFac and many other IOC do that easily for you just check their docs. last let us not forget that VNext is still way early, so you would see many changes, and you always have to upgrade and test and fix things, that is the price of working with Beta stuff :) |
@devmondo IoC containers generally are not responsible for loading assemblies into appdomain. Autofac can scan assembly for registrations AFAIK, but not load it from file system or database. Latest dev builds suggest that it is going to rc in foreseeable future. I is interesting at least to hear dev ideas on these, because in CoreClr I cant reference assembly. Only packaged dependencies are allowed. |
@aanufriyev you are absolutely right, that is MEF fraemwork job. about CoreCLR, i have been to frustrated with it, because thee whole point of it is to be able to run your app cross platform, yet the .NET packages them selves are not all compatible with it |
@devmondo I have found a way to load dependencies. Here is a project: https://github.com/OrchardCMS/Brochard |
@aanufriyev awesome man, thanks for the hint 👍 |
Cant find a way to load dependency after project is compiled to binaries. Is it possible on CoreClr? Or any plans to support some kind of dynamic plugin systems?
The text was updated successfully, but these errors were encountered: