如何使用默认构建操作 = None 制作 VS2013 SQL 脚本项模板 [英] How Do I Make a VS2013 SQL Script Item Template With Default Build Action = None

查看:27
本文介绍了如何使用默认构建操作 = None 制作 VS2013 SQL 脚本项模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想制作一个适用于 Visual Studio 2013 的项目模板,这样当我右键单击并选择 添加 -> 新建项目 时,我可以选择我的从可用选项中选择脚本模板,将其与模板内容一起添加到我的项目中,并将默认构建操作自动设置为无.

I want to make an item template that works with Visual Studio 2013 such that when I right-click and select Add -> New Item I am able to choose my script template from the available selection, add it to my project with the template content, and have the default build action set to None automatically.

我能够创建一个可以工作的项目模板,它将具有默认内容,但我无法将默认构建操作设置为无(它始终设置为构建).

I am able to create an item template that will work and it will have the default content but I am unable to have the default build action be set to None (it is always set to Build).

我能够在 Visual Studio 2010 和 Visual Studio 2012 中使用 .vstemplate 文件中的以下 WizardExtension 和 WizardData 指令使其正常工作,但要么我做错了,要么它在 Visual Studio 2013 中不再受支持.

I was able to get this working in Visual Studio 2010 and Visual Studio 2012 using the WizardExtension and WizardData directives below inside the .vstemplate file, but either I'm doing it wrong or it's no longer supported in Visual Studio 2013.

我在 VS2012 .vstemplate 文件中使用的示例:

Example of what I used in VS2012 .vstemplate file:

<向导扩展>

<程序集>Microsoft.VisualStudio.Data.Tools.Package,版本=11.1.0.0,Culture=Neutral,PublicKeyToken=b03f5f7f11d50a3a,自定义=空

Microsoft.VisualStudio.Data.Tools.Package.Project.TemplateWizard

< /WizardExtension>

<向导数据>

<构建操作>无

<项目属性>

< /WizardData>

感谢任何帮助.

推荐答案

需要更新程序集版本到12.0.0.0

You need to update the assembly version to 12.0.0.0

<WizardExtension>
  <Assembly>Microsoft.VisualStudio.Data.Tools.Package, Version=12.0.0.0, Culture=Neutral, PublicKeyToken=b03f5f7f11d50a3a, Custom=null</Assembly>     
  <FullClassName>Microsoft.VisualStudio.Data.Tools.Package.Project.TemplateWizard</FullClassName>
</WizardExtension>
<WizardData>
    <BuildAction>None</BuildAction>
    <ItemAttributes></ItemAttributes>
</WizardData>

这篇关于如何使用默认构建操作 = None 制作 VS2013 SQL 脚本项模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆