x64 & x86 assembly difference.
-
Hi, Can we find on which platform the dll/.Net assembly has been build? Either on x64 or x86. I want to find this through C# code. I tried this through reflection but not able to find correct property. Thanks in Advance.
From memory, the
Environment
class has members to discover the system processor.Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
-
From memory, the
Environment
class has members to discover the system processor.Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
-
Thanks for reponse. From that i will get the current CPU bits, but what i want to find is that, I will get a dll as input and from that i need to find on which platform it has been builted. Does it support x86 or x64 or both. Thanks
Well, if built with X64 it won't run on 32 bit Windows, not sure about the other way round though.
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
-
Hi, Can we find on which platform the dll/.Net assembly has been build? Either on x64 or x86. I want to find this through C# code. I tried this through reflection but not able to find correct property. Thanks in Advance.
I wouldn't like to say for sure that you can't but I'd expect not. Assemblies are after all a load of metadata tables and MSIL instructions. The very essence of it all is that MSIL isn't linked to one particular processor - the JIT compiler does that at runtime. Why do you need to know this?
Regards, Rob Philpott.
-
Hi, Can we find on which platform the dll/.Net assembly has been build? Either on x64 or x86. I want to find this through C# code. I tried this through reflection but not able to find correct property. Thanks in Advance.
-
Hi, Can we find on which platform the dll/.Net assembly has been build? Either on x64 or x86. I want to find this through C# code. I tried this through reflection but not able to find correct property. Thanks in Advance.
If it's built for x64, the .exe/.dll file will use PE32+. For x86 or AnyCPU assemblies, it'll use PE32. If you need to find the difference between AnyCPU and x86-only assemblies, you'll need to look at the 32-bit flag in the CLR Runtime Header. You can find the documentation of the .dll/.exe file format on http://www.microsoft.com/whdc/system/platform/firmware/PECOFF.mspx[^].