.NET-如何确定dll是该dll的32位还是64位版本 [英] .NET - How can I tell if a dll is a 32bit or 64bit version of that dll

查看:170
本文介绍了.NET-如何确定dll是该dll的32位还是64位版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在应用程序中有一个项目,该项目根据所构建的机器上的处理器体系结构来构建32位或64位版本的dll,以便于测试.

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.

我可能可以预测将在给定计算机上使用的dll,但是我们有几个开发人员,一些具有64位计算机,一些具有32位计算机,并且我希望能够检查是否将其构建到实时服务器中已经使用了32位版本的dll或64位版本的dll.

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.

检查dll的属性不会为您提供此类信息.有办法吗?

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

谢谢

推荐答案

我不确定是否有任何方式可以查看该程序集是否针对x64/x86进行了编译. 您可以使用corflags进行指定. msdn页

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

您还可以使用这来自代码:Module.GetPEKind方法

Also you coulduse this from code: Module.GetPEKind Method

这篇关于.NET-如何确定dll是该dll的32位还是64位版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆