Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 625035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:15:57+00:00 2026-05-13T19:15:57+00:00

I can build my C# project for x86 and for x64. Why? I thought

  • 0

I can build my C# project for x86 and for x64. Why? I thought it generates a special code which is not platform specific at all.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T19:15:57+00:00Added an answer on May 13, 2026 at 7:15 pm

    First, let me be blunt and say that I don’t know the whole story here, I’m going to answer with what I think I know. I’ll happily delete or change my answer if someone can tell me where I’m wrong.

    The way I understand it, this setting is a flag that says “the assembly is supposed to be run in this type of architecture”. That’s for the x86 and x64 setting. The MSIL/.NET setting is just saying “I don’t care, I can run on either, so pick the one that is optimal or available.”

    For instance, you might be making calls to Win32 API functions through P/Invoke, in which case the assembly won’t work on x64 and you should flag it as x86.

    So if my understanding is correct, here’s how the three flags make the assembly run (note, it’s the main assembly, the program assembly, that dictates this, not each individual assembly for themselves) on different platforms:

    Setting        x86      x64  <-- Platform (CPU/OS)
    MSIL/.NET     32-bit   64-bit
    x86           32-bit   32-bit
    x64           N/A (*)  64-bit
    

    The N/A for x64 assembly on x86 means that the assembly won’t load, and you’ll get an exception if you try.

    Also note that conflicting settings involving x86 and x64 will make your program crash at one point or another. If the main assembly is set to x86, it will run as a 32-bit process on both a 32-bit and 64-bit operating system, and any attempts at loading assemblies flagged as x64 will fail. Likewise, if the main assembly is set to x64, it will only run on 64-bit operating system, and any attempt at loading an assembly set to x86 will fail.

    A MSIL main executable assembly will run as 32-bit on a 32-bit operating system (like if it was set to x86, with the above failure point,) and as 64-bit on a 64-bit operating system (like if it was set to x64, with the above failure point.)

    Obviously Typically, you want to go with the MSIL setting if you’re not calling assemblies that are flagged as something specific, and as long as you’re not doing P/Invoke that isn’t portable across 32-bit and 64-bit (I have no idea if this works, if P/Invoke to win-api functions will map to a correctly bitsized dll or not.)

    Since references are pointers, and pointers are stored as a native x-bit address on the two platforms, depending on the amount of references you have, you might have a case against just going with MSIL. You should, however, verify that this is a problem before you make a change to your settings.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My entry point project has explicit x86 and x64 platform configuration. All referenced projects
My entry point project has explicit x86 and x64 platform configuration. All referenced projects
I can reference Matlab code from a x86 based project, but not from an
I just found the IUI project on google code where you can build websites
I can build my project in Xcode(4.2) for debugging without issues, but when I
I can't build successfully project in VS2010 it shows me error: Error 579 Unable
In Delphi 2009, how can I build a project using command line. I tried
I have a project that is coded in C. I can build it, change
I recently started learning JavaFX. At the moment I can't build any JavaFX project
Can we set the build settings for different targets in the project build settings

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.