Giter VIP home page Giter VIP logo

lazyman.modularloader's Introduction

LazyMan.ModularLoader

一个方面的插件加载器,适用于.net core , 支持插件程序集隔离,和插件依赖, 支持加载原生库

该库目前处于非常早期的状态,请勿用于生产环境
因为自.net 5以后的一些变更,使得改项目目前无法加载asp.net core的SubApp

项目介绍

1. LazyMan.ModularLoader

基础的插件加载器,这里面所有的类都是抽象的,要想使用需要里面里面HostLoader来 自己封装自己的加载器

2. LazyMan.ModularLoader.AspNetCore

asp.net core 的 子应用程序(SubApp) 加载器,目的是将任意的现有基于asp.net core的web应用,以完全隔离的方式 加载当前进程,并且映射到子路径上(注意,静态html文件和js文件路径可能出现错误)

捐赠 Donate

  • 代码贡献(推荐)
  • 逻辑和理论贡献(推荐)
  • RMB捐献(仅限手头富裕的小伙伴)

手头富裕的可以支持我将此项目继续下去i😜, 一毛不嫌少, 一万不嫌多 哈哈

wechat alipay

lazyman.modularloader's People

Contributors

john0king avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

lazyman.modularloader's Issues

Can this library work as Plugin Loader?

Hello,

Instead of Modules i want my assembly subparts to behave as plugins, load/unload on runtime without affecting host app. Can you guide me how this is possible with this library, currently i am using DotnetCorePlugins
but this have bug in razor that your library solves, so i am interested if i can port to yours.

thanks

Thinking of Module vs Plugin

modularization mains:

  1. cold module load
  2. module can call each other
  3. module may cause host app crash
  4. module is static for the app
  5. module may need isolation ( data and service isolation, not Type/Assembly isolation )

plugin mains:

  1. cold plugin load
  2. cold plugin unload
  3. hot plugin load
  4. hot plugin unload
  5. must need Type/Assembly isolation
  6. plugin may need to call each other
  7. plugin may need to modify the parent plugin host app.
  8. plugin must not cause host app crash! (the plugin itself can crash)
  9. plugin is dynamic for the app

problems

  1. hot plugin unload is limited (emit stuff can not be used)
  2. assembly isolation is hard : while we need some framework type in the plugin's host app (a framework type may not in the host app or a framework.extensions type is inside a plugin too [consider of , self-contained, different runtime (desktop runtime, server runtime and .net 6 introduce an assembly missing that is System.Drawing.Common) ])
  3. Plugin call each other has the same problem like problem 2
  4. A type shared across host app and plugin , then it can not be isolated to it's child plugin.

已知问题汇总

目前已经支持常规的asp.net core 3.x 的网站加载(即,采用默认的DI和没有动态代理的网站, autofac 再不支持动态代理的情况下,理论上是支持的)

已知问题:

  1. 动态代理不支持 可卸载 Alc
  2. 根据 Abp的测试,Abp采用的动态Controller/Endpoint 也会出现问题
  3. 目前的实现不支持热插拔, 在下个版本中,将采用中间件方式重新映射子应用路径, 到时候将支持热插拔
  4. asp.net core 程序集必须加载到AssemblyLoadContext.Default 里面去, 这里应该是 alc 的设计问题, 目前正在提交新的issue

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.