Carl Weis
Carl Weis

Reputation: 7072

How can I set the default build target to x86 for all projects, in Visual Studio 2008?

Is there is a way to set the default build action to x86, instead of Any CPU in Visual Studio 2008?

That way all new projects will be compiled for x86, and great features like edit and continue will work.

Perhaps a registry hack or somthing simple, like a global option.

Thanks, Carl

Upvotes: 3

Views: 4145

Answers (2)

Hans Passant
Hans Passant

Reputation: 942267

You could edit the project templates with, say, Notepad. They are located in Common7\IDE\ProjectTemplates(Cache)\CSharp\Windows\xxxx\*.zip. Edit the .csproj file in the .zip archive and add

<PlatformTarget>x86</PlatformTarget>

to the Debug and/or Release PropertyGroup.

Or consider upgrading to VS2010, x86 is now the default.

Upvotes: 4

stijn
stijn

Reputation: 35911

maybe not that simple, but I start all my projects from a template; the template imports a default project like

<Import Project="..\template\defaults.csproj" />

and there the default platform is set to x86 (there is even no Any CPU):

<PropertyGroup>
  <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
  <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
  <!--goes on setting outputpath, default build options, ...-->
</PropertyGroup>

Upon loading a newly created project from this template, VS automatically takes Debug|x86 as config.

Upvotes: 1

Related Questions