我刚开始在输出窗口中收到此错误?看起来我现在需要转向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.
更多推荐
代码合同崩溃
发布评论