JetBrains dotCover代码覆盖率分析失败,错误“无效的流标题”

时间:2017-02-13 07:11:21

标签: .net visual-studio asp.net-core resharper dotcover

我正在尝试使用JetBrains dotCover确定我的.Net Core解决方案在Visual Studio 2015中的单元测试覆盖率。

不幸的是,它失败并显示错误“覆盖率分析:无效的流标题!”。

我正在使用ReSharper Ultimate版本2016.3.2。

来自日志:

|I| UnitTestSessionManager | HandleAnalysisFinished
|I| CoverageSnapshotManager | Merging snapshots 1-4
|I| CoverageSnapshotManager | Merge finished
|I| UnitTestSessionOperationManager| Operation aborted
|I| UnitTestSessionOperationManager| Operation error: Invalid stream header!
|I| UnitTestSessionOperationManager| Operation finished
|W| | Invalid stream header!

--- EXCEPTION #1/2 [PdbException]
Message = “Invalid stream header!”
ExceptionPath = Root.InnerException
ClassName = JetBrains.Metadata.Utils.Pdb.Common.PdbException
HResult = COR_E_EXCEPTION=80131500
Source = JetBrains.Platform.Metadata
StackTraceString = “
at JetBrains.Metadata.Utils.Pdb.PdbHeader..ctor(BinaryReader reader)
at JetBrains.Metadata.Utils.Pdb.PdbFile..ctor(Stream pdbStream)
at JetBrains.dotCover.DataAccess.SnapshotCore.Dal.Complementer.CoverageSnapshotStorageComplementer.TryGetAssemblyMetadataAndPdb(Lifetime lifetime, FileSystemPath assemblyPath, Stream& metadataStream, PdbFile& pdbFile)
at JetBrains.dotCover.DataAccess.SnapshotCore.Dal.Complementer.CoverageSnapshotStorageComplementer.Complement(ISnapshotStorage sourceStorage, IStorageSectionWriter storageAppender, ISnapshotScopeInfoProvider snapshotScopeInfoProvider, Predicate`1 includeModule, IEnumerable`1 patternFilters, IEnumerable`1 attributeFilters, IProgressIndicator progress)
at JetBrains.dotCover.DataAccess.SnapshotCore.Dal.CoverageSnapshotManager.Complement(IStorageDescriptor source, ISnapshotScopeInfoProvider snapshotScopeInfoProvider, Predicate`1 includeModule, IEnumerable`1 patternFilters, IEnumerable`1 attributeFilters, IProgressIndicator progress)
at JetBrains.dotCover.Workspace.Impl.UnitTesting.Model.UnitTestSessionManager.HandleAnalysisFinished(ProgressId progressId, Boolean complementSnapshot, CoverageFilterSet coverageFilters, AttributeFilterSet attributeFilters, ElementInfoProvider elementInfoProvider)
at SyncInvokeHandleAnalysisFinished(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
”

--- Outer ---

--- EXCEPTION #2/2 [LoggerException]
Message = “Invalid stream header!”
ExceptionPath = Root
ClassName = JetBrains.Util.LoggerException
InnerException = “Exception #1 at Root.InnerException”
HResult = COR_E_APPLICATION=80131600
StackTraceString = “
at System.ServiceModel.Dispatcher.ErrorBehavior.HandleErrorCommon(Exception error, ErrorHandlerFaultInfo& faultInfo)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessageCleanup(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage9(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage8(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.ProcessError(Exception e)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
at System.ServiceModel.Dispatcher.ChannelHandler.DispatchAndReleasePump(RequestContext request, Boolean cleanThread, OperationContext currentOperationContext)
at System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest(RequestContext request, OperationContext currentOperationContext)
at System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(IAsyncResult result)
at System.ServiceModel.Dispatcher.ChannelHandler.OnAsyncReceiveComplete(IAsyncResult result)
at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)
at System.ServiceModel.Channels.TransportDuplexSessionChannel.TryReceiveAsyncResult.OnReceive(IAsyncResult result)
at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)
at System.ServiceModel.Channels.SynchronizedMessageSource.ReceiveAsyncResult.OnReceiveComplete(Object state)
at System.ServiceModel.Channels.SessionConnectionReader.OnAsyncReadComplete(Object state)
at System.ServiceModel.Channels.PipeConnection.OnAsyncReadComplete(Boolean haveResult, Int32 error, Int32 numBytes)
at System.ServiceModel.Channels.OverlappedContext.CompleteCallback(UInt32 error, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)

1 个答案:

答案 0 :(得分:5)

dotCover 2016.3存在问题,新款"便携式" pdb文件。

你可以:

  • 使用"完整" pdb文件,通过编辑project.json中的属性
  • 取消选中"包括未加载的解决方案程序集到coverage结果"在ReSharper中设置→选项→dotCover→常规。

这将在2017.1修复。