Howto load assemby at runtime before AssemblyResolve event?

前端 未结 2 1151
日久生厌
日久生厌 2020-12-01 15:06

Actually i tried to implement some kind of \'statically linked\' assemblies, within my solution. So i tried the following:

  • Adding a reference to my assembly wi
2条回答
  •  执念已碎
    2020-12-01 15:26

    Just in case you didn't know, there is a tool called ILMerge from MS Research that merges assemblies into one file.

    Also you can create Multi-file assemblies using the Assembly Linker tool.

    Plus to answer you original question, the problem I think is that the runtime does not know that the assembly you loaded manually is the one it should be looking for. So in the assembly resolve event instead of loading the assembly again, just pass back the reference to the assembly that you've manually loaded.

提交回复
热议问题