2010-08-10 29 views

回答

4

您可以用記事本編輯項目模板。他們位於Common7\IDE\ProjectTemplates(Cache)\CSharp\Windows\xxxx\*.zip。編輯在.zip檔案中的.csproj文件,並添加

<PlatformTarget>x86</PlatformTarget> 

到調試和/或釋放的PropertyGroup。

或考慮升級到VS2010,x86現在是默認設置。

+0

謝謝。我已升級到2010年,但仍需要在2008年的一些項目上工作,而無需轉換項目文件。 – 2010-08-11 11:13:53

1

也許不是那麼簡單,但我開始從一個模板我的所有項目;模板導入像

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

,有平臺的默認設置爲86默認的項目(甚至有沒有任何CPU):

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

一旦從這個模板,VS加載一個新創建的項目自動將Debug | x86作爲配置。

+0

在這樣做時,您是否必須爲每個項目類型提供項目模板? – 2010-08-10 11:04:27

+0

你是什麼意思與項目類型? 模板csproj只有15行左右,它只是一個的Guids,AssmblyName,OutputType和版本,以及行我上面顯示。我想這是你需要的任何C#項目? – stijn 2010-08-10 11:18:16

+0

WinForms,控制檯,WPF等 – 2010-08-10 11:36:24

相關問題