Problems loading assembly dependencies dynamically at run-time

前端 未结 3 1309
逝去的感伤
逝去的感伤 2021-01-06 08:11

let me try to explain my problem. I\'m currently trying to develop a small \"plugin-framework\" written in .Net (mainly for experimenting a bit). So the idea is to have a ma

3条回答
  •  清歌不尽
    2021-01-06 08:24

    BTW: You can speed up loading assemblies considerably if you cache your assemblies that you already resolved in a Dictionary. If A depends on B, C and B depends on C and you load A, AssemblyResolve will be called twice for C, and loading the assembly only once is faster :)

    (I am not sure if it is always the case that AssemblyResolve is called more than once, but I noticed it when debugging a project once. And it does not hurt to cache the assemblies...)

提交回复
热议问题