有没有办法从磁盘加载程序集,并没有得到锁定在磁盘上的文件再执行code?我永远无法理解为什么必须锁定文件,因为code将在RAM中加载和JIT编译的?
Is there a way to load an assembly from disk and execute code in it without getting the file locked on disk? I never understood why it is necessary to lock the file since the code will be loaded in RAM and JIT-compiled?
这是可能的,你可以使用的的Assembly.Load(byte []的)以加载程序集,以及。该程序集不具有加载上下文,可以反复加载它。管理这可是不容易的,你一定会找到答案。
It's possible, you can use Assembly.Load(byte[]) to load an assembly as well. That assembly doesn't have a "loading context", you can load it repeatedly. Managing this is however not easy, you're bound to find out.
上一篇:如何从Word文件使用C#中提取文本?文本、文件、Word
下一篇:Windows窗体:DataGridView的问题用的backgroundColor排序后窗体、问题、Windows、backgroundColor