How can I determine if an .EXE file (not my application, not another running application, not a .NET application) is 32-bit or 64-bit in C#? The best I found is this and I'm guessing there's a native .NET call.
Asked
Active
Viewed 625 times
0
-
Does this answer your question? [How to detect that a given PE file (exe or dll) is 64 bit or 32 bit](https://stackoverflow.com/questions/1153090/how-to-detect-that-a-given-pe-file-exe-or-dll-is-64-bit-or-32-bit) – GSerg Jan 25 '20 at 17:23
-
@GSerg Yes, that references the same link I have in my question. If that's the best way, it works. But I'm asking to find out if there's a native .NET way to do this. – David Thielen Jan 25 '20 at 17:32
-
I don't see that link mentioned in that question. – GSerg Jan 25 '20 at 17:33
-
@GSerg The link you provided has a link to the same Windows call that http://zuga.net/articles/cs-how-to-determine-if-a-program-process-or-file-is-32-bit-or-64-bit/#getbinarytype uses. – David Thielen Jan 25 '20 at 17:58
-
Microsoft implemented PEFile class in https://www.nuget.org/packages/Microsoft.Diagnostics.Tracing.TraceEvent/ and that can be used to check fitness. – Lex Li Jan 25 '20 at 19:17