T4包含在扩展中抛出UriFormatException

时间:2015-09-28 02:13:48

标签: visual-studio-2015 t4 visual-studio-extensions visual-studio-sdk

我正在开发一个VISIX项目,该项目将使用T4模板生成一些类。我的所有T4模板都包含一个常用的实用程序模板' Utilities.t4'。但是,当我开始生成代码时,我在VS 2015中收到以下错误:

There was an error loading the include file 'Utilities.t4'. The transformation will not be run. The following Exception was thrown:

System.UriFormatException: Invalid URI: The format of the URI could not be determined.

    at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
    at System.Uri..ctor(String uriString) 
    at Microsoft.VisualStudio.TextTemplating.VSHost.TextTemplatingService.CheckSecurityZone(String path)
    at Microsoft.VisualStudio.TextTemplating.VSHost.TextTemplatingService.LoadIncludeText(String requestFileName, String& content, String& location)
    at Microsoft.VisualStudio.TextTemplating.Engine.ProcessIncludeDirective(Directive directive, ITextTemplatingEngineHost host, VisitedFiles includedFiles)

ClassMetadata.tt    13

VS中包含文件的属性为:

  • 构建操作 - 内容
  • 复制到输出目录 - 如果更新则复制
  • 自定义工具 - (空白)
  • 格式输出 - 错误
  • 包含在VISIX中 - true
  • Build on Build - false

有人可以帮助解决问题吗?

0 个答案:

没有答案