How to load a .net module without the assembly man

2019-09-16 01:08发布

How can I load a .net module(just a normal assembly except it doesn't contain assembly manifest) without the need of the manifest? I have some assemblies that throws this error when I try to run them:

The module was expected to contain an assembly manifest

Normally I can fix this problem by recompiling the assembly using ilasm after adding the assembly manifest:

.assembly test{  }

But is there other work around for this problem? Can Assembly.LoadModule(...) fix my problem?

标签: .net manifest
1条回答
别忘想泡老子
2楼-- · 2019-09-16 01:58

Manifest is a part of an logical assembly which may consist of many files. And only single of them contains assembly manifest(where are links to all other assembly files), so you can make try-catch block and load successfully only the main assembly modules.

查看更多
登录 后发表回答