本文介绍了CCDoc以未捕获的异常失败:索引超出范围。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在将合同发布到XML doc文件并使用混淆器
。NET Reactor ,但仅限于某些项目。我还没有找到一个模式...

I'm getting an unhandled exception when emitting contracts into XML doc file and using the obfuscator.NET Reactor but only for some of the projects. I still haven't found a pattern...

CCDoc因未捕获的异常而失败:索引超出范围。必须是非负数且小于集合的大小。

 参数名称:index

 堆栈跟踪:    at System.Collections.Generic.List`1.get_Item(Int32 index)

    在Microsoft.Cci.MutableContracts.ContractExtractor.ExtractClump(List`1 blockList,Int32 startBlockIndex,Int32 startStmtIndex,Int32 endBlockIndex,Int32 endStmtIndex)

    在Microsoft.Cci.MutableContracts.ContractExtractor.Visit(BlockStatement blockStatement)

    在Microsoft.Cci.MutableContracts.ContractExtractor.SplitMethodBodyIntoContractAndCode(IBlockStatement blockStatement)

    在Microsoft.Cci.MutableContracts.ContractExtractor.SplitMethodBodyIntoContractAndCode(IContractAwareHost主机,ISourceMethodBody sourceMethodBody,PdbReader pdbReader)

    在Microsoft.Cci.Contracts.LazyContractExtractor.GetMethodContractFor(对象方法)

    在Microsoft.Cci.Contracts.CodeContractsContractExtractor.GetMethodContractFor(对象方法)

    在CCDoc.CCDocContractHelper.TryGetMethodContract(CodeContractAwareHostEnvironment主机,IMethodReference方法,IMethodContract& methodContract,DocTracker docTracker)

     at CCDoc.ContractTraverser.ContractPackager.PackageMethodContracts(IMethodDefinition method,Boolean isPure)

    在CCDoc.ContractTraverser.Visit(IMethodDefinition methodDefinition)

    在Microsoft.Cci.BaseMetadataTraverser.Visit(IEnumerable`1 typeMembers)

    在Microsoft.Cci.BaseMetadataTraverser.Visit(ITypeDefinition typeDefinition)

    在CCDoc.ContractTraverser.Visit(ITypeDefinition typeDefinition)

    在Microsoft.Cci.BaseMetadataTraverser.Visit(IEnumerable`1 namespaceMembers)

    在Microsoft.Cci.BaseMetadataTraverser.Visit(INamespaceDefinition namespaceDefinition)

    在Microsoft.Cci.BaseMetadataTraverser.Visit(IEnumerable`1 namespaceMembers)

    在Microsoft.Cci.BaseMetadataTraverser.Visit(INamespaceDefinition namespaceDefinition)

    在Microsoft.Cci.BaseMetadataTraverser.Visit(IEnumerable`1 namespaceMembers)

    在Microsoft.Cci.BaseMetadataTraverser.Visit(INamespaceDefinition namespaceDefinition)

    在Microsoft.Cci.BaseMetadataTraverser.Visit(IEnumerable`1 namespaceMembers)

    在Microsoft.Cci.BaseMetadataTraverser.Visit(INamespaceDefinition namespaceDefinition)

    在Microsoft.Cci.BaseMetadataTraverser.Visit(IModule模块)

    在CCDoc.CCDoc.GetContracts(选项选项,DocTracker docTracker)

    在CCDoc.CCDoc.RealMain(String [] args)

    在CCDoc.CCDoc.Main(String [] args)

CCDoc failed with uncaught exception: Index was out of range. Must be non-negative and less than the size of the collection.
  Parameter name: index
  Stack trace:    at System.Collections.Generic.List`1.get_Item(Int32 index)
     at Microsoft.Cci.MutableContracts.ContractExtractor.ExtractClump(List`1 blockList, Int32 startBlockIndex, Int32 startStmtIndex, Int32 endBlockIndex, Int32 endStmtIndex)
     at Microsoft.Cci.MutableContracts.ContractExtractor.Visit(BlockStatement blockStatement)
     at Microsoft.Cci.MutableContracts.ContractExtractor.SplitMethodBodyIntoContractAndCode(IBlockStatement blockStatement)
     at Microsoft.Cci.MutableContracts.ContractExtractor.SplitMethodBodyIntoContractAndCode(IContractAwareHost host, ISourceMethodBody sourceMethodBody, PdbReader pdbReader)
     at Microsoft.Cci.Contracts.LazyContractExtractor.GetMethodContractFor(Object method)
     at Microsoft.Cci.Contracts.CodeContractsContractExtractor.GetMethodContractFor(Object method)
     at CCDoc.CCDocContractHelper.TryGetMethodContract(CodeContractAwareHostEnvironment host, IMethodReference method, IMethodContract& methodContract, DocTracker docTracker)
     at CCDoc.ContractTraverser.ContractPackager.PackageMethodContracts(IMethodDefinition method, Boolean isPure)
     at CCDoc.ContractTraverser.Visit(IMethodDefinition methodDefinition)
     at Microsoft.Cci.BaseMetadataTraverser.Visit(IEnumerable`1 typeMembers)
     at Microsoft.Cci.BaseMetadataTraverser.Visit(ITypeDefinition typeDefinition)
     at CCDoc.ContractTraverser.Visit(ITypeDefinition typeDefinition)
     at Microsoft.Cci.BaseMetadataTraverser.Visit(IEnumerable`1 namespaceMembers)
     at Microsoft.Cci.BaseMetadataTraverser.Visit(INamespaceDefinition namespaceDefinition)
     at Microsoft.Cci.BaseMetadataTraverser.Visit(IEnumerable`1 namespaceMembers)
     at Microsoft.Cci.BaseMetadataTraverser.Visit(INamespaceDefinition namespaceDefinition)
     at Microsoft.Cci.BaseMetadataTraverser.Visit(IEnumerable`1 namespaceMembers)
     at Microsoft.Cci.BaseMetadataTraverser.Visit(INamespaceDefinition namespaceDefinition)
     at Microsoft.Cci.BaseMetadataTraverser.Visit(IEnumerable`1 namespaceMembers)
     at Microsoft.Cci.BaseMetadataTraverser.Visit(INamespaceDefinition namespaceDefinition)
     at Microsoft.Cci.BaseMetadataTraverser.Visit(IModule module)
     at CCDoc.CCDoc.GetContracts(Options options, DocTracker docTracker)
     at CCDoc.CCDoc.RealMain(String[] args)
     at CCDoc.CCDoc.Main(String[] args)

 

 

推荐答案

启用"将合同发送到XML文档文件"时,我遇到了几乎相同的错误。

I am experiencing almost the same error when enabling 'Emit contracts into XML doc file.'.

有人知道如何进一步诊断这个问题吗?我们完全无法生成合同文档。

Does anybody have an idea how to further diagnose this problem? We are completely unable to generate the contracts documentation.

如果我能帮助修复此错误,请告诉我。

Please let me know if I can be of assistance in fixing this bug.

谢谢,Ranco

 

  CCDoc failed with uncaught exception: Index was out of range. Must be non-negative and less than the size of the collection.
  Parameter name: index
  Stack trace:    at System.Collections.Generic.List`1.get_Item(Int32 index)
     at Microsoft.Cci.MutableContracts.ContractExtractor.ExtractContract(List`1 currentClump)
     at Microsoft.Cci.MutableContracts.ContractExtractor.ExtractContractsAndReturnRemainingStatements(List`1 linearBlockIndex, Int32 startBlock, Int32 startStatement, Int32 lastBlockIndex, Int32 lastStatementIndex)
     at Microsoft.Cci.MutableContracts.ContractExtractor.Visit(BlockStatement blockStatement)
     at Microsoft.Cci.MutableContracts.ContractExtractor.SplitMethodBodyIntoContractAndCode(IBlockStatement blockStatement)
     at Microsoft.Cci.MutableContracts.ContractExtractor.SplitMethodBodyIntoContractAndCode(IContractAwareHost host, ISourceMethodBody sourceMethodBody, PdbReader pdbReader)
     at Microsoft.Cci.Contracts.LazyContractExtractor.GetMethodContractFor(Object method)
     at Microsoft.Cci.Contracts.CodeContractsContractExtractor.GetMethodContractFor(Object method)
     at CCDoc.CCDocContractHelper.TryGetMethodContract(CodeContractAwareHostEnvironment host, IMethodReference method, IMethodContract& methodContract, DocTracker docTracker)
     at CCDoc.ContractTraverser.ContractPackager.PackageMethodContracts(IMethodDefinition method, Boolean isPure)
     at CCDoc.ContractTraverser.Visit(IMethodDefinition methodDefinition)
     at Microsoft.Cci.BaseMetadataTraverser.Visit(IEnumerable`1 typeMembers)
     at Microsoft.Cci.BaseMetadataTraverser.Visit(ITypeDefinition typeDefinition)
     at CCDoc.ContractTraverser.Visit(ITypeDefinition typeDefinition)
     at Microsoft.Cci.BaseMetadataTraverser.Visit(IEnumerable`1 namespaceMembers)
     at Microsoft.Cci.BaseMetadataTraverser.Visit(INamespaceDefinition namespaceDefinition)
     at Microsoft.Cci.BaseMetadataTraverser.Visit(IEnumerable`1 namespaceMembers)
     at Microsoft.Cci.BaseMetadataTraverser.Visit(INamespaceDefinition namespaceDefinition)
     at Microsoft.Cci.BaseMetadataTraverser.Visit(IEnumerable`1 namespaceMembers)
     at Microsoft.Cci.BaseMetadataTraverser.Visit(INamespaceDefinition namespaceDefinition)
     at Microsoft.Cci.BaseMetadataTraverser.Visit(IEnumerable`1 namespaceMembers)
     at Microsoft.Cci.BaseMetadataTraverser.Visit(INamespaceDefinition namespaceDefinition)
     at Microsoft.Cci.BaseMetadataTraverser.Visit(IEnumerable`1 namespaceMembers)
     at Microsoft.Cci.BaseMetadataTraverser.Visit(INamespaceDefinition namespaceDefinition)
     at Microsoft.Cci.BaseMetadataTraverser.Visit(IModule module)
     at CCDoc.CCDoc.GetContracts(Options options, DocTracker docTracker)
     at CCDoc.CCDoc.RealMain(String[] args)
     at CCDoc.CCDoc.Main(String[] args)


这篇关于CCDoc以未捕获的异常失败:索引超出范围。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-20 12:57