6

How do I test an existing managed .NET .dll to see if its 32-bit or 64-bit?

Known dead ends:

  • "dumpbin /header" doesn't work, it returns 32-bit for everything (its only looking at the native win32 headers).
  • Dependency Walker doesn't work, as its for native win32 .dll's.
Contango
  • 76,540
  • 58
  • 260
  • 305

2 Answers2

10

Start up Visual Studio 2008 Command Prompt, go to the folder your assembly is in type "corflags.exe assemblyName.dll" and you should get the following info back

Version   : v4.0.30319
CLR Header: 2.5
PE        : PE32
CorFlags  : 1
ILONLY    : 1
32BIT     : 0
Signed    : 0
Iain
  • 6,392
  • 2
  • 30
  • 50
  • 3
    For VS 2012, CorFlags shows 32BITREQ(UIRED) and 32BITPREF(ERRED). See http://blogs.microsoft.co.il/blogs/sasha/archive/2012/04/04/what-anycpu-really-means-as-of-net-4-5-and-visual-studio-11.aspx and http://msdn.microsoft.com/en-us/library/ms164699%28v=vs.110%29.aspx . – TrueWill May 22 '13 at 14:27
1

See How to determine if a .NET assembly was built for x86 or x64?

Community
  • 1
  • 1
Contango
  • 76,540
  • 58
  • 260
  • 305
  • This question also gives the answer, but it doesn't include the keywords "managed", "32-bit" or "64-bit", so its a bit difficult to quickly navigate to it. – Contango Mar 02 '11 at 12:41