Comments (5)
ah ok.
Perhaps a better way forward for me then, is first shadow-copy the plugins from the IFileProvider to some temp physical directory first on startup, and then use dotnetcoreplugins to load them from there as normal. I can then IFileProvider.Watch for changes to plugins in the source at runtime and when they change, Unload the ALC, shadow copy again the new versions, and reload them with dotnetcoreplugins again. Should allow me to host plugins anywhere IFileProvider supports. Should also allow me to update the plugins at the source because they won't be locked by any process due to the addition of the shadow copy before load. I'll close this
from dotnetcoreplugins.
I don't think it's currently possible to do this. APIs this library calls in System.Runtime.Loader.AssemblyLoadContext requires file paths. Introducing a file provider abstraction means I would also need to know whether or not the file provider is physical or not....which IMO defeats the purpose of the abstraction.
from dotnetcoreplugins.
Could the load from stream method be used instead to load the assembly?
I know this wouldn't cater for unmanaged / native libs.
Perhaps another possibility: When the ALC can't find an assembly at an expected path, I think it raises a resolve event to allow you to satisfy the resolution manually - perhaps here could be a good place to query from an IFileProvider?
from dotnetcoreplugins.
LoadFromStream might work, but LoadFromPath is optimized to handle on-disk assemblies better. LoadFromStream requires paging the entire assembly into memory.
And like you mentioned, this is only available for managed assemblies.
from dotnetcoreplugins.
Yeah, that sounds like a better approach.
from dotnetcoreplugins.
Related Issues (20)
- Use WeakReference to check if unload is successful HOT 3
- [Question] What happened to AddDependencyContext? HOT 9
- Add hot-reload to ASP.NET Core sample HOT 2
- How do I "Unload" a plugin/dll HOT 1
- Error starting application when plugin controller decorating with [ApiController]
- How can i use Plugin DBContext ? HOT 2
- Docker file build problems HOT 3
- [Question] Diamond dependency & shared types doesn't work
- Diamond dependency & shared types doesn't work when using NuGet packages HOT 2
- Error on loading NuGet package HOT 2
- [Question] [Help Wanted] JSON Serialization problems; can assembly name or version be changed at load time? HOT 1
- [Question] Some questions about the state of the project HOT 8
- 支持卸载吗 HOT 2
- [Question] How to inject Logger or IConfiguration in Plugins ? I tried and failed HOT 1
- Using the library in MacOs project
- [Question] Capturing exceptions
- RobiniaDocs API Explorer
- [Question] System.Data.SqlClient could not be found on my plugin HOT 1
- [Question] Hot-reload managed assemblies using assembly file lock instead of through FileStream
- System.PlatformNotSupportedException on Android
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dotnetcoreplugins.