Skip to content
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

Closed
aanufriyev opened this issue Dec 30, 2014 · 11 comments
Closed

Is there a way to dynamicaly load dependencies?(For plugin system) #252

aanufriyev opened this issue Dec 30, 2014 · 11 comments

Comments

@aanufriyev
Copy link

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?

@runxc1
Copy link

runxc1 commented Jan 8, 2015

With things like the Managed Extensibility Framework you should be able to create a dynamic plugin system already.

@aanufriyev
Copy link
Author

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?

@devmondo
Copy link

devmondo commented Jan 8, 2015

@aanufriyev i suggest checking Autofac, it does what you need and have support in VNext

@aanufriyev
Copy link
Author

@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.

@devmondo
Copy link

devmondo commented Jan 8, 2015

@aanufriyev i you maybe right about coreclr but i read this article
http://blogs.msdn.com/b/webdev/archive/2014/06/17/dependency-injection-in-asp-net-vnext.aspx

and it seams the solution works for both full and core by using #if statement in the code.

@aanufriyev
Copy link
Author

@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.
For example:
Pluggable ICacheProvider. I have default in memory implementation. Someone wants to use Memcached, so he creates package with some libraries and dependencies, puts it in Plugins folder and... How can I load it from my code on demand?

@devmondo
Copy link

devmondo commented Jan 9, 2015

@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 :)

@aanufriyev
Copy link
Author

@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.

@devmondo
Copy link

devmondo commented Jan 9, 2015

@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

@aanufriyev
Copy link
Author

@devmondo I have found a way to load dependencies. Here is a project: https://github.com/OrchardCMS/Brochard
Dynamic compilation is broken, but main idea should be working. Look at DefaultExtensionLoader.Load methods.

@devmondo
Copy link

devmondo commented Jan 9, 2015

@aanufriyev awesome man, thanks for the hint 👍

natemcmaster pushed a commit that referenced this issue Nov 13, 2018
…' to help us diagnose issues

Fixes #252 - help output shown twice in dotnet-watch
Fixes #250 - add dotnet-watch --list. Prints a list of all files discovered
Fixes #249 - better error message when GenerateWatchList fails
@ghost ghost locked as resolved and limited conversation to collaborators Dec 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants