How to load an .exe as a .NET assembly?

后端 未结 4 403
被撕碎了的回忆
被撕碎了的回忆 2021-02-02 16:10

Can I just use?:

Assembly.LoadFile

Not sure if this is the way to do this?

But when I try that approach, it throws a Could not lo

4条回答
  •  北荒
    北荒 (楼主)
    2021-02-02 17:10

    Yes, you can load a .Net exe the same way as you would load a Dll. The error you get is caused by dependencies of your exe. Make sure that the those dependencies can be found, i.e. are in your assembly search path.

提交回复
热议问题