471,627 Members | 2,316 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,627 software developers and data experts.

platform dependent calls and environment detection

Joe
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?
Feb 2 '06 #1
2 1491
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.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Joe" <Jo*@discussions.microsoft.com> wrote in message
news:8C**********************************@microsof t.com...
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?

Feb 2 '06 #2

"Joe" <Jo*@discussions.microsoft.com> wrote in message
news:8C**********************************@microsof t.com...
|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.
Feb 2 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.