-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to get architecture of the current processor #43246
Comments
@danmosemsft I don't believe that is it. How would I get the architecture of the current processor? This is close: But that gives the process architecture of the currently running app, not of the machine. I need to be able to detect if an x86 app is running on an x64 or arm64 processor. Using the above, running x86 on x64 returns x86 which is not what I need. |
Ah, I'm not sure whether we attempt to expose that -- generally, the OS tries hard to conceal it from you. Outside of .NET, I have usually seen people check eg the PROCESSOR_ARCHITEW6432 environment variable (at least that's for detecting WOW64, not sure about on ARM) |
Is it related with adding osx-arm64 #43313? |
The System.Reflection namespace is not intended for environmental detection. The linked System.Runtime.InteropServices is a better fit. |
@danmosemsft and @TonyValenti This is a good question and one that warrants a longer discussion. The I also think this is enough of niche case that we should defer this until we get more user feedback. I would have some reservations about creating a new API. For context, APIs that represent this distinction on Windows are |
Duplicate of #58463 |
It seems as though the ProcessArchitecture enum does not contain ARM64/32 variants which should be added.
The text was updated successfully, but these errors were encountered: