How can I programmatically tell in C# if an unmanaged lib is x86 or x64?
Asked
Active
Viewed 206 times
2
-
1Duplicate of http://stackoverflow.com/questions/480696/how-to-find-if-native-dll-is-compiled-as-x64-or-x86 – Brian Rasmussen Feb 25 '10 at 11:42
1 Answers
2
Unless you get a better solution - run Corflags using Process.Start
and parse the output.
Or better yet - read the file header from .NET - luckily a this question already been answered: How to find if native dll is compiled as x64 or x86?

Community
- 1
- 1

Dror Helper
- 30,292
- 15
- 80
- 129
-
2
-
hi Dror, I Have already gone through the link but it is working for DLL not for libraries. Thanks. – Devloper Feb 25 '10 at 11:46
-
Hi All, I am getting exception on the below line when i am trying to find whether the lib is x86 or x64... UInt32 peHead = br.ReadUInt32(); Is i need to do some chnages for the library files. – Devloper Feb 25 '10 at 12:01