get current platform (x86, x64)

  • Thread starter Thread starter Frank Uray
  • Start date Start date
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
 
This is covered thoroughly elsewhere on this forum. Start with
IntPtr.Size.
 
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

Back
Top