Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. x64 & x86 assembly difference.

x64 & x86 assembly difference.

Scheduled Pinned Locked Moved C#
csharpquestion
7 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rahul RK
    wrote on last edited by
    #1

    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.

    H R L D 4 Replies Last reply
    0
    • R Rahul RK

      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.

      H Offline
      H Offline
      Henry Minute
      wrote on last edited by
      #2

      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.”

      R 1 Reply Last reply
      0
      • H Henry Minute

        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.”

        R Offline
        R Offline
        Rahul RK
        wrote on last edited by
        #3

        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

        H 1 Reply Last reply
        0
        • R Rahul RK

          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

          H Offline
          H Offline
          Henry Minute
          wrote on last edited by
          #4

          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.”

          1 Reply Last reply
          0
          • R Rahul RK

            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.

            R Offline
            R Offline
            Rob Philpott
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            • R Rahul RK

              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.

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Do you mean you want to find out whether it has been build for "x86" or "x64" or "I64" or "Any CPU"? If you just need to distinguish between 64/32bit at runtime you can look at the size of IntPtr.

              1 Reply Last reply
              0
              • R Rahul RK

                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.

                D Offline
                D Offline
                Daniel Grunwald
                wrote on last edited by
                #7

                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[^].

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups