开发者

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

开发者 https://www.devze.com 2023-01-11 11:17 出处:网络
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 projec开发者_如何学Pythonts will be compiled for x86, and great features like edit

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 projec开发者_如何学Pythonts 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


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消