Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>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.</p> <p>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."</p> <p>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.</p> <p>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:</p> <pre><code>Setting x86 x64 &lt;-- Platform (CPU/OS) MSIL/.NET 32-bit 64-bit x86 32-bit 32-bit x64 N/A (*) 64-bit </code></pre> <p>The N/A for x64 assembly on x86 means that the assembly won't load, and you'll get an exception if you try.</p> <p>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.</p> <p>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.)</p> <p><strike>Obviously</strike> 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.)</p> <p>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 <em>might</em> 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.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload