Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to know in run time if i'm on x86 or x64 mode in c# [duplicate]

Tags:

c#

.net

x86

64-bit

Possible Duplicate:
How do I tell if my application is running as a 32 or 64 bit application?

Hi

I have an app in c# (Framework 3.5 SP1) and I need to load an unmanaged assembly at run time but there are two different versions, one for x86 and another for x64, so I need to know at run time in which mode is the app running

I have seen this POST but it's for C++, is there an easier way to do it in C#? or how can I do this in C#?

Thanks

like image 855
DkAngelito Avatar asked Feb 20 '11 02:02

DkAngelito


1 Answers

You can check whether IntPtr.Size is 4 or 8.

like image 52
SLaks Avatar answered Sep 18 '22 09:09

SLaks