1

我有一个只有项目文件和 AssemblyInfo 文件的类库项目模板。这是模板中项目文件的内容:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <!-- This adds default build flavors -->
  <Import Project="..\common.targets" />
  <PropertyGroup>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{$guid1$}</ProjectGuid>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>$safeprojectname$</RootNamespace>
    <AssemblyName>$safeprojectname$</AssemblyName>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Core" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

在我使用此模板添加新项目后,错误的属性被添加到解决方案中。这是正在添加的解决方案文件的一部分:

    {C12D9BEF-3A1D-4E99-B314-35D92D8F5BC1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    {C12D9BEF-3A1D-4E99-B314-35D92D8F5BC1}.Debug|Any CPU.Build.0 = Debug|Any CPU
    {C12D9BEF-3A1D-4E99-B314-35D92D8F5BC1}.Debug|x86.ActiveCfg = Debug|Any CPU
    {C12D9BEF-3A1D-4E99-B314-35D92D8F5BC1}.Release|Any CPU.ActiveCfg = Debug|Any CPU
    {C12D9BEF-3A1D-4E99-B314-35D92D8F5BC1}.Release|Any CPU.Build.0 = Debug|Any CPU
    {C12D9BEF-3A1D-4E99-B314-35D92D8F5BC1}.Release|x86.ActiveCfg = Debug|Any CPU

如您所见Debug|Any CPU,为Release配置指定。我应该怎么做才能使模板正常工作?

4

0 回答 0