MSVS:如何将x64设置为默认值,而不是AnyCPU?

时间:2015-03-05 16:18:20

标签: visual-studio templates

MS Visual Studio 2013 Update 4。

我创建自己的项目模板。根据我的模板创建新项目时,默认平台为AnyCPU

enter image description here

但是我需要x64(它在此组合框中也存在)必须是默认值而不是AnyCPU

我的csproj - 文件设置我尝试这样做:

<!-- <Platform Condition=" '$(Platform)' == '' ">x64</Platform> -->
<Platform>x64</Platform>

Bot它对我没有帮助。如何将模板中的x64设置为默认值,而不是AnyCPU

2 个答案:

答案 0 :(得分:0)

您是否在csproj文件中尝试过这个?

<PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">x64</Platform>
    ...
</PropertyGroup>

另一种选择可能是从csproj文件中删除AnyCPU条目(如果你根本不需要它们)。

第三个选项是在解决方案的配置管理器中定义x64。

答案 1 :(得分:0)

看起来默认平台是按字母顺序排列的第一个平台

例如,如果您有两个平台:Win32和x64,则默认值为Win32。但是,如果将Win32重命名为x86,则默认为x64。

来源:https://aras-p.info/blog/2017/03/23/How-does-Visual-Studio-pick-default-config/platform/