Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/visual-studio/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio Visual Studio 2015项目模板类型_Visual Studio_Vs Extensibility_Project Template - Fatal编程技术网

Visual studio Visual Studio 2015项目模板类型

Visual studio Visual Studio 2015项目模板类型,visual-studio,vs-extensibility,project-template,Visual Studio,Vs Extensibility,Project Template,我正在创建一个项目模板,并将其放入“新建项目”窗口中的特定部分。我在template文件夹中找到了一个类似MyTemplate.vstemplate xml的文件,其中有一个条目“ProjectType”。这似乎是解决问题的正确方法,只是在那里设置一个适当的值,但我找不到所有可用类型的列表。将模板放在“Visual C#”或“Visual Basic”部分没有问题,但我想放在“其他项目类型”或“Visual Studio解决方案”下 最大的成就是在扩展的同时设置模板 如有任何意见,将不胜感激。谢

我正在创建一个项目模板,并将其放入“新建项目”窗口中的特定部分。我在template文件夹中找到了一个类似MyTemplate.vstemplate xml的文件,其中有一个条目“ProjectType”。这似乎是解决问题的正确方法,只是在那里设置一个适当的值,但我找不到所有可用类型的列表。将模板放在“Visual C#”或“Visual Basic”部分没有问题,但我想放在“其他项目类型”或“Visual Studio解决方案”下

最大的成就是在扩展的同时设置模板

如有任何意见,将不胜感激。谢谢

csproj内容:

    <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{$guid1$}</ProjectGuid>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>$safeprojectname$</RootNamespace>
    <AssemblyName>$safeprojectname$</AssemblyName>
    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup>
    <StartupObject />
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.ComponentModel.Composition" />
    <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.Net.Http" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="ModuleRegistry.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <ItemGroup>
    <None Include="App.config" />
  </ItemGroup>
  <ItemGroup />
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
  <Target Name="TemplateProjectOutputGroup">
  </Target>
</Project>

调试
任意CPU
{$guid1$}
图书馆
性质
$safeprojectname$
$safeprojectname$
v4.5.2
512
真的
任意CPU
真的
满的
假的
bin\Debug\
调试;痕迹
促使
4.
任意CPU
pdbonly
真的
bin\Release\
痕迹
促使
4.

您不应该使用
ProjectType

编辑包含MyTemplate.vstemplate文件的csproj,并如下设置
OutputSubPath
值:

<VSTemplate Include="MyTemplate.vstemplate">
    <OutputSubPath>ELEVATION</OutputSubPath>
</VSTemplate>

高程

但是没有像
VSTemplate
这样的条目,您需要添加它。那么,具体在哪里?在
下还是更深?在“VisualStudio解决方案”部分我必须使用什么值?抱歉,我不明白。csproj文件中没有列出MyTemplate.vstemplate吗?如果你这样做,它是如何列出的?我很抱歉误解。但是
vstemplate
未列在项目文件的任何位置,您建议添加它。我在问到底应该在哪里添加。