Question

I have VS.NET 10.0.40219.1 SP1 in 2 computers and when I create a new C# Winform app only do it with Properties/Build/Platform x86, and the target let me choose AnyCpu/x64, but can't set it in the configuration (however, libraries work fine).

If I try to change it in the project file manually, I get a lot of nasty errors. Is this normal behavior, a bug or a problem in my installation?

P.D: When I change manually the project, this happend:

Warning 1 The OutputPath property is not set for project '*.csproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Debug' Platform='x86'. This error may also appear if some other project is trying to follow a project-to-project reference to this project, this project has been unloaded or is not included in the solution, and the referencing project does not build using the same or an equivalent Configuration or Platform. c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets

When I reopen the project, ALL the references become invalid

Was it helpful?

Solution

It is normal for Visual Studio to create WinForms projects with just an x86 platform. I have no idea if that's because historically x86 was the only platform type or because x86 is the most commonly used value or for some other reason.

It's also normal to have problems when the project file is manually modified, try to avoid doing that where possible.

To create another platform configuration in a C# project

  1. Select Build | Configuration manager
  2. Select <New...> in the Active Solution Platform field
  3. Select the new type you want
  4. Click on OK

OTHER TIPS

Visual Studio used to create AnyCPU apps by default. I think both VS2005 and VS2008 did this, though they may have changed it for VS2008. Here's what happened: a lot of AnyCPU apps ended up broken on 64-bit systems, because they were built with dependencies on 32-bit libraries. If you tried to run an AnyCPU app that had a 32bit dependancy on a 64bit system, you got a 64bit process that would crash as soon as it tried to load your 32bit dll.

To fix this, the default was changed to use the x86 option. If you want to use AnyCPU, you must now setup the environment for it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top