1

In VS.NET 2010, I have a Windows Service project in a solution. All the other projects (libraries) are set to Any CPU. But I cannot change the Windows Service to anything besides x86.

In the project properties for the Windows Service, Platform target is set to "Any CPU" but Platform only has the option for "Active (x86)". I need to change that to x64 or Any CPU.

Does anyone have some idea how this can be updated?

4thSpace
  • 43,672
  • 97
  • 296
  • 475

2 Answers2

1

Build -> Configuration Manager Find your windows service, open the Platform drop down, click New and create the Any CPU and / or x64 platforms.

Allan Elder
  • 4,052
  • 17
  • 19
1

You are mixing up the Platform target setting as specified on the Project + Properties Build tab for a managed project and the active Solution Platform as visible in the Configuration Manager.

They are two very different things and VS2010 made that pretty confusing. The Solution Platform only matters for C++ projects, the kind of projects that actually have a target architecture dependency that needs to be selected up front. Since a different compiler and linker is needed at build time. Managed projects can deal with anything thanks to the jitter, the real machine code that's executed is created at runtime.

You need to completely ignore the Solution Platform setting since it has no meaning for managed projects. Very sad that VS2010 named the default one "x86", it used to be named "AnyCPU" in previous VS versions. Which of course does make more sense for managed projects.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536