1

I need to compile my C#-project to platform "x86". There are several options:

(1) Rightclick on my project > Properties > Build > Platform target > I can set "x86" here. Configuration is set to "Active (Debug)" and Platform is set to "Active (Any CPU)".

(2) Solution configuration: "Active Solution Platform" "Project Contexts: Platform"

My questions are:

  • Where are the differences between these options?
  • Where do I need to set the platform to "86".
  • Does "Active Solution Platform" in (2) overwrite "Project Contexts: Platform" ?
  • If I set "x86" in (1), is "Any CPU" set to "x86".

There is a similar discussion at What does the Visual Studio "Any CPU" target mean?. Unfortunately it does not anwer my questions.

Many thanks in advance, J.

  • Have a look at configuration page of solution properties – Pavel Anikhouski Apr 27 '20 at 09:21
  • That's why I am asking. –  Apr 27 '20 at 09:53
  • The original 8086 microprocessor has a 24 bit address and 8/16 bit data and there was a single version of the component made by Intel and 2nd sourced by AMD. x86 compiles code for this processor. Since every newer processor can run 8086 code code compiled with x86 will work with any processor. Later AMD and Intel broke there 2nd source agreement so the two manufactures code does not always work on the other manufactures processor. Using Any CPU creates code that will work on both manufactures processor using 32 bit and 64 bit addressing (along with 16 and 32 bit data). – jdweng Apr 27 '20 at 10:14
  • The question is not about the difference between 64-bit and 32-bit platforms. –  Apr 27 '20 at 11:51
  • 1
    Based on my test, I think the two ways can make the same thing. First, I think these options are the same. Second, when we need to create app in 32 bit, we need to set it to x86. Third, Active Solution Platform will overwrite the setting in Platform. As for your last question, I am not sure what you mean. Can you possibly describe in detail ? – Jack J Jun Apr 28 '20 at 02:03
  • I updated the post. Hope its clearer now. –  Apr 28 '20 at 05:38
  • I have seen the link you provided, I think the answer is ok. Can you tell me what is your doubt about 'Any CPU'? – Jack J Jun Apr 29 '20 at 05:59
  • In the Configuration Manager I can set a "Projects context". Here I can set platform x86 for a project. In "Active Solution platform" of the same Configuration Manager I can set x86, but I can also set x64. And in the Build-porperties of the solution I can also choose another platform. So there a 3 possibilities. I do not understand the effects. –  May 10 '20 at 15:22

0 Answers0