代码合同崩溃

编程入门 行业动态 更新时间:2024-10-19 14:40:17
本文介绍了代码合同崩溃 - AsmMeta失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我刚开始在输出窗口中收到此错误?看起来我现在需要转向CC。 : - (

I just started getting this error in my output window? Looks like I'll need to turn of CC for now. :-(

AsmMeta failed with uncaught exception: startIndex cannot be larger than length of string. Parameter name: startIndex Stack trace: at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) at System.String.Substring(Int32 startIndex, Int32 length) at AsmMeta.DeleteMethodBodiesButLeaveContracts.ExtractCondition(String sourceText, String sourceLanguage) at AsmMeta.DeleteMethodBodiesButLeaveContracts.EmitContracts(MethodBody methodBody, Int32 firstIndex, Int32 lastIndex, List`1 operations, Dictionary`2 offset2Label, ILGenerator generator) at AsmMeta.DeleteMethodBodiesButLeaveContracts.ProcessMethodBody(MethodBody methodBody, Int32 lastIndex) at AsmMeta.DeleteMethodBodiesButLeaveContracts.Visit(MethodBody methodBody) at Microsoft.Cci.MutableCodeModel.MetadataMutator.Visit(IMethodBody methodBody) at Microsoft.Cci.MutableCodeModel.MetadataMutator.Visit(MethodDefinition methodDefinition) at Microsoft.Cci.MutableCodeModel.MetadataMutator.Visit(IMethodDefinition methodDefinition) at Microsoft.Cci.MutableCodeModel.MetadataMutator.Visit(List`1 methodDefinitions) at Microsoft.Cci.MutableCodeModel.MetadataMutator.Visit(TypeDefinition typeDefinition) at Microsoft.Cci.MutableCodeModel.MetadataMutator.Visit(NamespaceTypeDefinition namespaceTypeDefinition) at Microsoft.Cci.MutableCodeModel.MetadataMutator.Visit(INamespaceTypeDefinition namespaceTypeDefinition) at Microsoft.Cci.MutableCodeModel.MetadataMutator.Visit(INamespaceMember namespaceMember) at Microsoft.Cci.MutableCodeModel.MetadataMutator.Visit(List`1 namespaceMembers) at Microsoft.Cci.MutableCodeModel.MetadataMutator.Visit(UnitNamespace unitNamespace) at Microsoft.Cci.MutableCodeModel.MetadataMutator.Visit(NestedUnitNamespace nestedUnitNamespace) at Microsoft.Cci.MutableCodeModel.MetadataMutator.Visit(INestedUnitNamespace nestedUnitNamespace) at Microsoft.Cci.MutableCodeModel.MetadataMutator.Visit(INamespaceMember namespaceMember) at Microsoft.Cci.MutableCodeModel.MetadataMutator.Visit(List`1 namespaceMembers) at Microsoft.Cci.MutableCodeModel.MetadataMutator.Visit(UnitNamespace unitNamespace) at Microsoft.Cci.MutableCodeModel.MetadataMutator.Visit(NestedUnitNamespace nestedUnitNamespace) at Microsoft.Cci.MutableCodeModel.MetadataMutator.Visit(INestedUnitNamespace nestedUnitNamespace) at Microsoft.Cci.MutableCodeModel.MetadataMutator.Visit(INamespaceMember namespaceMember) at Microsoft.Cci.MutableCodeModel.MetadataMutator.Visit(List`1 namespaceMembers) at Microsoft.Cci.MutableCodeModel.MetadataMutator.Visit(UnitNamespace unitNamespace) at Microsoft.Cci.MutableCodeModel.MetadataMutator.Visit(NestedUnitNamespace nestedUnitNamespace) at Microsoft.Cci.MutableCodeModel.MetadataMutator.Visit(INestedUnitNamespace nestedUnitNamespace) at Microsoft.Cci.MutableCodeModel.MetadataMutator.Visit(INamespaceMember namespaceMember) at Microsoft.Cci.MutableCodeModel.MetadataMutator.Visit(List`1 namespaceMembers) at Microsoft.Cci.MutableCodeModel.MetadataMutator.Visit(UnitNamespace unitNamespace) at Microsoft.Cci.MutableCodeModel.MetadataMutator.Visit(NestedUnitNamespace nestedUnitNamespace) at Microsoft.Cci.MutableCodeModel.MetadataMutator.Visit(INestedUnitNamespace nestedUnitNamespace) at Microsoft.Cci.MutableCodeModel.MetadataMutator.Visit(INamespaceMember namespaceMember) at Microsoft.Cci.MutableCodeModel.MetadataMutator.Visit(List`1 namespaceMembers) at Microsoft.Cci.MutableCodeModel.MetadataMutator.Visit(UnitNamespace unitNamespace) at Microsoft.Cci.MutableCodeModel.MetadataMutator.Visit(NestedUnitNamespace nestedUnitNamespace) at Microsoft.Cci.MutableCodeModel.MetadataMutator.Visit(INestedUnitNamespace nestedUnitNamespace) at Microsoft.Cci.MutableCodeModel.MetadataMutator.Visit(INamespaceMember namespaceMember) at Microsoft.Cci.MutableCodeModel.MetadataMutator.Visit(List`1 namespaceMembers) at Microsoft.Cci.MutableCodeModel.MetadataMutator.Visit(UnitNamespace unitNamespace) at Microsoft.Cci.MutableCodeModel.MetadataMutator.Visit(RootUnitNamespace rootUnitNamespace) at AsmMeta.DeleteMethodBodiesButLeaveContracts.Visit(RootUnitNamespace rootUnitNamespace) at Microsoft.Cci.MutableCodeModel.MetadataMutator.Visit(Module module) at Microsoft.Cci.MutableCodeModel.MetadataMutator.Visit(Assembly assembly) at AsmMeta.DeleteMethodBodiesButLeaveContracts.Visit(Assembly assembly) at AsmMeta.AsmMeta.Run() at AsmMeta.AsmMeta.RealMain(String[] args) at AsmMeta.AsmMeta.Main(String[] args)

推荐答案

我相信我已经解决了这个问题(另一个人报告了类似的错误),但如果哟你可以给我你的解决方案(压缩),然后我可以确保它也修复了这种情况。对此感到抱歉!

I believe I've fixed this (another person reported a similar bug), but if you can send me your solution (zipped), then I can make sure it also fixes this case. Sorry about that!

如果它有助于追踪问题,那么当字段声明中有明确的字段初始化时就会发生这种情况。如果你将你的初始化转移到ctor身体并且问题消失了,那么我确定它是同样的问题。

In case it helps track down the problem, it happened when there was an explicit field initialization at the field declaration. If you move your initalizations into the ctor body and the problem goes away then I'm sure it is the same issue.

更多推荐

代码合同崩溃

本文发布于:2023-11-12 12:15:05,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1581474.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:合同   代码

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!