platform dependent calls and environment detection

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i would like to my c# project to have the Platform target be set to any cpu.
i would like to detect at run-time whether the environment is x86, x64 or
Itanium,
any ideas?
 
Joe,

You can set the platform target as you wish, and AFAIK, it should run
fine with little changes (although there are caveats with all things,
depending on what you do).

As for determining what the platform is, you can use the classes in the
System.Management namespace to determine the processor type (specifically,
the Win32_Processor WMI class).

Hope this helps.
 
|i would like to my c# project to have the Platform target be set to any
cpu.
| i would like to detect at run-time whether the environment is x86, x64 or
| Itanium,
| any ideas?

Why would you ever need this?
If you wan't to run on any platform, your code must be built using 'anycpu'
as target platform, so what's the use of knowing the platform at run-time?


Willy.
 
Can you make native DLL calls in XBAP?

I think you should refactor the DLL. I doubt you have that many places
where pointers are cast to integers and vice-versa.
 
Back
Top