问题显示:

Error 6
Compiling transformation: 'Microsoft.VisualStudio.TextTemplatingBED07DAE3B6FD53FA947017E5A5F7A123173F8AEEBD8059AD94FFEA4200EC409BE022035F5E3463EFD6E2867E0DEFBDC09BAEEE8B986A775611AFBBB7D110480.GeneratedTextTransformation' does not contain a definition for 'Host'
and no extension method 'Host' accepting a first argument of type 'Microsoft.VisualStudio.TextTemplatingBED07DAE3B6FD53FA947017E5A5F7A123173F8AEEBD8059AD94FFEA4200EC409BE022035F5E3463EFD6E2867E0DEFBDC09BAEEE8B986A775611AFBBB7D110480.GeneratedTextTransformation'
could be found (are you missing a using directive or an assembly reference?)
e:\Projects\XYX\XYX.Server\MarketDataModuleClientInterface\api.helper.tt
24 50
IMarketDataModuleClientlLibrary

其实问题很简单:

<#@ template hostspecific="true" language="C#" #>
<#@ output extension=".txt" #>
<#@ import namespace="System.CodeDom.Compiler" #>
<#
string message = "test message";
this.Host.LogErrors(new CompilerErrorCollection()
{ new CompilerError(
this.Host.TemplateFile, // Identify the source of the error.
0, 0, "0", // Line, column, error ID.
message) }); // Message displayed in error window.
#>

注意第一行: hostspecific="true"

如果是 false就会出现最前面的那个错误

Template Code 无法使用 this.Host 报错的更多相关文章

  1. Django_重装系统后无法使用 sqlite 数据库报错:com.intellij.execution.ExecutionException: Exception in thread "main" java.lang.ClassNotFoundException: org.sqlite.JDBC

     重装系统后无法使用 sqlite 数据库报错 报错 : com.intellij.execution.ExecutionException: Exception in thread "ma ...

  2. vs code调试console程序报错--preLaunchTask“build”

    网上有其他大神给出的建议是注释掉launch.json中的 "preLaunchTask": "build", 但是这种方式也会造成一个问题,就是再使用F5调试 ...

  3. django.template.exceptions.TemplateDoesNotExist: login.html报错

    前言 在某一次按以前的步骤使用Django    “django.template.exceptions.TemplateDoesNotExist: login.html”错误,在以为是html文件出 ...

  4. Code::Blocks20.03 编译报错

    Code::Blocks最近出了新版20.03,进入官网选择下载了附带MinGW版的安装包后,编译HelloWorld就报错(CB一直以来都有问题,新版还是这样...) 主要有两个问题: ld.exe ...

  5. Visual Studio Code 使用 Git插件报错 - Permission denied (publickey)

    在使用GitHub的时候,为了避免每次输入用户名密码,都会使用SSH方式代替Https. 按网上教程,大多数使用SSH-KeyGen生成公私钥对,而后上传公钥至Github,并切换Repositori ...

  6. 使用Visual Studio Code调试React Native报错

    报错信息: [Error] Error: Unknown error: not all success patterns were matched. It means that "react ...

  7. 'Error Domain=NSURLErrorDomain Code=-999' AFNetworking请求报错

    早上请求app请求登录接口发现了下面的错误信息: Error Domain=NSURLErrorDomain Code=-999 "已取消" UserInfo={NSErrorFa ...

  8. python3 无法使用flask.ext.* 报错的解决方法

    python3 使用flask的一些扩展功能的导入方法是 from flask_bootstrap import Bootstrapfrom flask_moment import Momentfro ...

  9. 执行opatch apply 报错 OPatch failed with error code 73

    .执行opatch apply 报错 OPatch failed [oracle@ora_11g 14275605]$ /opt/oracle/product/db_1/OPatch/opatch a ...

随机推荐

  1. odoo写邮件添加收件人

    在任何可以写消息的地方点击鼠标     或者回复消息     写消息的框会聚焦并变大             点击撰写框右上角的弹出窗图标     弹出完整的撰写消息窗口     在红色的地方添加收件 ...

  2. EF Core使用SQL调用返回其他类型的查询 ASP.NET Core 2.0 使用NLog实现日志记录 CSS 3D transforms cSharp:use Activator.CreateInstance with an Interface? SqlHelper DBHelper C# Thread.Abort方法真的让线程停止了吗? 注意!你的Thread.Abort方法真

    EF Core使用SQL调用返回其他类型的查询   假设你想要 SQL 本身编写,而不使用 LINQ. 需要运行 SQL 查询中返回实体对象之外的内容. 在 EF Core 中,执行该操作的另一种方法 ...

  3. 技术发展晴雨表 细数CPU接口10年变迁

    http://cpu.zol.com.cn/160/1602240_all.html#p1602240 本文导航 第1页:10年磨10剑 CPU发展突飞猛进 第2页:462与423对垒 开启CPU竞争 ...

  4. webpack的安装个配置

    webpack在node下运行,首先先安装node 安装在全局:npm install webpack -g 在任何目录都可以运行 安装在局部:npm init -y npm install webp ...

  5. 王立平--Unity破解

    1.下载破解工具.关闭Unity,打开破解工具 watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMzQyNTUyNw==/font/5a6L5L2T/ ...

  6. attribute constructor&destructor

    attribute constructor&destructor 在看openwrt里libnl-tiny这个库的时候,遇到了C里面的构造函数这个概念. static void __init ...

  7. collection 模块 双端队列

    单端队列 用于同一进程中的队列,可以叫做单进程队列. queue 遵循先进先出,先进去的必须先出来 1.先进先出: impore queue q = queue.Queue() 实例化一个对象 q.p ...

  8. 网页 H5“线条” 特效实现方式(canvas-nest)

    先上图 (看博客空白处也可以呦): 前一阵浏览网站的时候,发现了这个好玩的东西,一直想找找怎么实现的,今天忙里偷闲,上网搜了一下,发现实现起来特别简单. 只需要在网页body里引入一个<scri ...

  9. Understanding When to use RabbitMQ or Apache Kafka Kafka RabbitMQ 性能对比

    Understanding When to use RabbitMQ or Apache Kafka https://content.pivotal.io/rabbitmq/understanding ...

  10. 基于Ubuntu 14.04 LTS编译Android4.4.2源码

    版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/gobitan/article/details/24367439 基于Ubuntu 14.04 LTS ...