.NET - How can I tell if a dll is a 32bit or 64bit version of that dll

天涯浪子 提交于 2020-01-24 13:06:31

问题


We have a project in our application that builds in a 32bit or a 64bit version of a dll depending on the processor architecture on the machine that it is built on, to facilitate testing.

I can likely predict the dll that will be used on a given machine, but we have several devs, some with 64bit machines, some with 32bit machines, and I want to be able to check if builds they put to the live server have gone up with the 32bit version of the dll or the 64bit version of the dll.

Checking properties of a dll doesn't give you this sort of information. Is there a way of getting it?

Thanks


回答1:


I'm not sure if there is any way you can see wether or not the assembly was compiled for x64 / x86. You can use corflags to specify though. msdn page

Also you coulduse this from code: Module.GetPEKind Method



来源:https://stackoverflow.com/questions/4947480/net-how-can-i-tell-if-a-dll-is-a-32bit-or-64bit-version-of-that-dll

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!