开发者

Isolating forced-32bit assemblies

Given a relatively big home-grown framework written in .NET. For an additional lower priority feature, we would like to use a third party open source project. However, this third party project is not safe to run in x64 mode, so we force it to compile 32bit. Due to this referenced 32bit assembly, VS wants our entire framework being compiled to 32bit via cascading dependencie开发者_高级运维s.

Question1: Is there a way to isolate the rest of the framework and allow that to compile to any platform? Question2: Assume that my framework runs in x64 mode, and during runtime I load a forced 32bit assembly. Would that work or would it throw AssemlyLoadWhateverException?


Answers:

  1. You can only compile as Any Platform if none of the referenced assemblies are 32-bit only.
    You can load the 32-bit only assembly using Assembly.LoadFrom and call it using Reflection, and still compile to any platform.

  2. That will not work. EDIT: It seems to work; I'm not sure why.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜