get current platform (x86, x64)

F

Frank Uray

Hi all

I am using "Any CPU" within my assemblies.
Is there a way to find out which platform is used ?
I like to know where the assembly is running on (x86, x64) ...

Thanks for any comments
and best regards
Frank Uray
 
N

not_a_commie

This is covered thoroughly elsewhere on this forum. Start with
IntPtr.Size.
 
A

Arne Vajhøj

Family said:
The size of IntPtr will be 8 under x64, and 4 under x86.

Console.WriteLine(IntPtr.Size == 4 ? "x86" : "x64");

Assuming that it is 32/64 bit of the CLR and not of Windows, then
that must be the easiest.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top