TemplateText TT 在Runtime发生 Could not load type ...... because the format is invalid
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的更多相关文章
- Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute'
[TypeLoadException: Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from as ...
- 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 ...
- 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, ...
- 网站部署后Parser Error Message: Could not load type 的解决方案
asp.net 的Webproject 项目是在64bit机上开发,默认选项发布后,部署到32bit的服务器上,出现Parser Error Message: Could not load type的 ...
- 解决:Could not load type 'System.ServiceModel.Activation.HttpModule' from assemb
解决:Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceMode ...
- Unable to load type System.Data.Entity.DynamicProxiesXXXXXrequired for deserialization.
Memcache实例的Get方法时抛出了异常“Unable to load type System.Data.Entity.DynamicProxies.AdInfoItems_19CD09C8E46 ...
- Spring.net Could not load type from string value问题解决办法
Spring.net Could not load type from string value "xxx" 错误原因可能有: 1.spring.net配置错误,注意要区别配置文件 ...
- 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 ...
- log4net 存储到oracle 调试 Could not load type [log4net.Appender.OracleAppender]
近期在弄webfrom oracle 调用 log4net 開始调试时不出数据,打开了log4net 自己的debug功能后发现: log4net: Logger [root] level set t ...
随机推荐
- linux install beanstalkd
you can instal it via git and then copy systemd script: Step 0. Install git yum install git Step 1. ...
- SVN支干合并(转载)
分支用来维护独立的开发支线,在一些阶段,你可能需要将分支上的修改合并到最新版本,或者将最新版本的修改合并到分支. 此操作十分重要,在团队开发中,如果你是SVN 的维护者此环节可以说是必不可少,因为团队 ...
- me12里更改信息记录的净价和有效价格,以及信息记录的条件价格
转自 http://blog.csdn.net/zeewjj/article/details/7941525REPORT ztest. DATA:l_kbetr LIKE konp-kbetr.l_k ...
- Java for LeetCode 082 Remove Duplicates from Sorted List II
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numb ...
- swift和oc的混编
一.Swift工程中加入oc代码 1.在将oc代码加入到Swift工程的时候Xcode会自动创建一个桥接文件“yourProgectName-Bridging-Header.h”,如果没有创建或者删除 ...
- Hive- Hive安装
Hive安装 1.1下载Hive安装包 官网:http://hive.apache.org/downloads.html 个人建议到这里下载:http://apache.forsale.plus/ 1 ...
- jsp和servlet的区别联系
jsp和servlet的区别联系 简单的说,SUN首先发展出SERVLET,其功能比较强劲,体系设计也很先进,只是,它输出HTML语句还是采用了老的CGI方式,是一句一句输出,所以,编写和修改HTML ...
- 分享知识-快乐自己:SpringMvc整合遇到-前台传JSON参数,后台实体类对象接收
前台数据转JSON对象: /** * * @param $myFrom:from表单 * @returns {{}} */ function from($myFrom) { var ebookEntr ...
- 初入 CLR - 阅读《CLR via C#》笔记
最近买了一本书<CLR via C#>阅读了第一章 - CLR 的执行模型,对 .NET 一直提到的 CLR 和 .NET Framework 有了一个大致的了解.我理解主要体现在: ■ ...
- zero to one (4)
复盘--天下武功唯快不破 There is no martial art is indefectible, while the fastest speed is the only way for lo ...