Severity Code Description Project File Line Suppression State

Error Running transformation: System.TypeLoadException: Could not load type ‘TKTFRS.BondVarietyEx’ from assembly ‘TKTFRSCommonDataTypeLibrary, Version=1.0.0.1, Culture=neutral, PublicKeyToken=null’ because the format is invalid.

at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)

at System.Reflection.RuntimeMethodInfo.get_ReturnType()

at norlib.CommonHelper.GetAsyncMethods(Type arg_tpInterface) in E:\Projects\norlib.tt\Common.cs:line 40

at Microsoft.VisualStudio.TextTemplatingFBE6B5AC633D2EBF765C1C720C201C41C55150808C444DDC45A30A738B537D2C6396CF0B87B3F8DD688B7E5B8C42607BD3EFFEC8C03484E019EEDA5489CE5F1F.GeneratedTextTransformation.Async2Sync(Type arg_tpInterface)

at Microsoft.VisualStudio.TextTemplatingFBE6B5AC633D2EBF765C1C720C201C41C55150808C444DDC45A30A738B537D2C6396CF0B87B3F8DD688B7E5B8C42607BD3EFFEC8C03484E019EEDA5489CE5F1F.GeneratedTextTransformation.TransformText() IWindModuleClient_TKTFRS E:\Projects\TKTFRS\Server\IWindModuleClient_TKTFRS\helper.TKTFRS.sync.tt 1

在这个例子中我们是BondVarietyEx这个对象无法装载,这个特别奇怪。因为编译完全没有错误,.net 版本也正确, 也都是AnyCpu,

去掉含有BondVarietyEx的函数后再次跑tt则没有错误,说明有罪的就是BondVarietyEx, 仔细查看BondVarietyEx的声明:

  [Serializable]
[StructLayout(LayoutKind.Sequential)]
public class BondVarietyEx
: BondVariety
{
public double 转换因子
{
get
{
return _cf;
}
set
{
_cf = value;
}
}
public static BondVarietyEx FromBondVariety(BondVariety arg_BondVariety, double arg_d转换因子)
{
........
} double _cf;
}

发现[StructLayout(LayoutKind.Sequential)], 但是其基类BondVariety已经放弃了这个Attribute, 因为无法做到定长, 但是衍生类却声明为定长, 难道是这个错误?

去掉此Attribute后一切OK~

TemplateText TT 在Runtime发生 Could not load type ...... because the format is invalid的更多相关文章

  1. Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute'

    [TypeLoadException: Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from as ...

  2. Could not load type 'System.Reflection.AssemblySignatureKeyAttribute' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c

    错误: Could not load type 'System.Reflection.AssemblySignatureKeyAttribute' from assembly 'mscorlib, V ...

  3. Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

    Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, ...

  4. 网站部署后Parser Error Message: Could not load type 的解决方案

    asp.net 的Webproject 项目是在64bit机上开发,默认选项发布后,部署到32bit的服务器上,出现Parser Error Message: Could not load type的 ...

  5. 解决:Could not load type 'System.ServiceModel.Activation.HttpModule' from assemb

    解决:Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceMode ...

  6. Unable to load type System.Data.Entity.DynamicProxiesXXXXXrequired for deserialization.

    Memcache实例的Get方法时抛出了异常“Unable to load type System.Data.Entity.DynamicProxies.AdInfoItems_19CD09C8E46 ...

  7. Spring.net Could not load type from string value问题解决办法

    Spring.net Could not load type from string value "xxx" 错误原因可能有: 1.spring.net配置错误,注意要区别配置文件 ...

  8. asp.net mvc项目使用spring.net发布到IIS后,在访问提示错误 Could not load type from string value 'DALMsSql.DBSessionFactory,DALMsSql'.

    asp.net mvc项目使用spring.net发布到IIS后,在访问提示错误 Could not load type from string value 'DALMsSql.DBSessionFa ...

  9. log4net 存储到oracle 调试 Could not load type [log4net.Appender.OracleAppender]

    近期在弄webfrom oracle 调用 log4net 開始调试时不出数据,打开了log4net 自己的debug功能后发现: log4net: Logger [root] level set t ...

随机推荐

  1. 网络新闻传输协议NNTP

    一.Usenet与新闻组 Usenet新闻系统是一个全球存档的“电子公告板”,各种主题的新闻组一应俱全.新闻组可以是面向全球泛泛而谈,也可以是只面向某一个地区区域. 整个系统是由一个大量计算机组成的一 ...

  2. 设置sudo的过期时间

    默认sudo的过期时间过短,经常要输入密码 sudo visudo Defaults env_reset找到这行代码 后面加上timestamp_timeout参数,数值是分钟 ,timestamp_ ...

  3. before-request , after-request

    1 . flask的中间件 1)@app.before_request     # 请求进入视图函数之前,类似于django中间件的request_process 2)@app.after_reque ...

  4. 基于springboot的RestTemplate、okhttp和HttpClient对比

    1.HttpClient:代码复杂,还得操心资源回收等.代码很复杂,冗余代码多,不建议直接使用. 2.RestTemplate: 是 Spring 提供的用于访问Rest服务的客户端, RestTem ...

  5. 0CTF 2017 部分Web的某些不一样的思路

    洒家参加了0CTF 2017,做了一些题目.赛后过了好几天,看网上已经有了一些写得不错的Writeup,这里就写一写洒家的一些不一样的思路. 一些不错的Writeup https://ctftime. ...

  6. Matlab的publish功能和cell功能

    Matlab的publish功能能够让写的代码变成优美的文档.类似为知笔记的markdown语言. cell功能配合publish使用,可以形成不同的功能块.而且调试的时候,可以按section调试. ...

  7. 国画经典之梅花PSD素材

    国画经典之梅花图片PSD素材,由huiyi8素材网提供. 地址:http://www.huiyi8.com/meihua/​

  8. the art of seo(chapter eleven)

    Tracking Results and Measuring Success goal -> driver ***Why Measuring Success Is Essential to th ...

  9. web性能压力测试工具http_load/webbench/ad

    http_load 下载地址:http://www.acme.com/software/http_load/http_load-12mar2006.tar.gz 程序非常小,解压后也不到100K 居家 ...

  10. PHP中调用接口

    引用:http://zhidao.baidu.com/question/454935450.html&__bd_tkn__=67bd5d3a742a8b244e09a86fb8b824aa95 ...