0

We have a C# project in Visual Studio 2010 where we want to generate code that will target 32 and 64 bit systems, and we want both Release and Debug builds. We understand that we can achieve the first goal by targeting "Any CPU" and it will get resolved at runtime. http://visualstudiohacks.com/articles/visual-studio-net-platform-target-explained/

Questions:

1. In the Batch Build dialog it shows settings for Release and Debug, x86 and x64 but no "Any CPU". If I check them all in the Build column then when I do a Build Solution or Rebuild Solution in the Build menu, it generates 4 separate target build folders for debug and release, x86 and x64. How do I get it to generate an "Any CPU" target?

2. In the Configuration Manager dialog it displays a bunch of rows labeled "Target contexts" (note 'context*s*' - plural). But only one row is populated and I don't see how to populate the others. What are the other rows for?

user316117
  • 7,971
  • 20
  • 83
  • 158
  • Does this question address the first part of yours? [Can't change target platform to “any CPU”](http://stackoverflow.com/questions/4012732/cant-change-target-platform-to-any-cpu) – juan.facorro Feb 13 '14 at 15:07
  • The interesting thing about that link is that they show a Configuration Manager populated with multiple rows and then they select "Any Platform" in one of those rows. So if I could figure out the answer to my second question it might held with the first one. But in my Configuration manager's one populated row, "Any Platform" is not shown as an option in the dropdown. Interestingly, it IS in a colleague's VS 2013. Is this a VS2010 issue? I thought "Any CPU" goes back to VS 2005. – user316117 Feb 13 '14 at 15:15
  • I don't have any version of VS installed in the computer I'm using at the moment, but the "Any CPU" does go way back. In the dropdown, is the option `` not showing? – juan.facorro Feb 13 '14 at 15:18
  • The thing is, "Any CPU" does not mean you can only get one single output and publish it on any platform rather it means VS is going to output for all available targets. If this is what you're asking. – MahanGM Feb 13 '14 at 15:18
  • @MahanGM That is not what it says in the documentation [here](http://msdn.microsoft.com/en-us/library/zekwfyz4%28v=vs.110%29.aspx). – juan.facorro Feb 13 '14 at 15:26
  • @MahanGM that's not what it says in the documentaion I lined to. – user316117 Feb 13 '14 at 15:29
  • @Juan.facorro Actually I was able to select for Any CPU in the "Active Solution" dropdown and NOW it's started appearing in the Platform dropdown. So I think we're partway to a solution. How do I add multiple rows to the Configuration Manager? – user316117 Feb 13 '14 at 15:32

1 Answers1

1

You can create AnyCpu target like this: right-click on solution -> configuration manager -> click on dropdown menù -> new -> select AnyCpu.

Mauro Sampietro
  • 2,739
  • 1
  • 24
  • 50