【发布时间】:2021-09-06 16:29:01
【问题描述】:
我创建了一个单元测试,但是当我尝试运行时,我在 JetBrains Rider 中收到以下错误消息。 我已经尝试了一个干净的解决方案和重建,但无济于事。 有问题的项目没有引用提到的程序集。
Test not run
Last runner error: TestRunner: NUnitTestReporter Could not load file or assembly 'nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
--- EXCEPTION #1/1 [LoggerException]
Message = “TestRunner: NUnitTestReporter Could not load file or assembly 'nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)”
ExceptionPath = Root
ClassName = JetBrains.Util.LoggerException
HResult = COR_E_APPLICATION=80131600
StackTraceString = “
at JetBrains.Util.ILoggerEx.LogMessage(ILogger this, LoggingLevel level, String message)
at JetBrains.ReSharper.UnitTestFramework.TestRunner.ServerEndpoint.<>c__DisplayClass9_2.<TryRegisterHandler>b__3()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)
at System.Threading.ThreadPoolWorkQueue.Dispatch()
”
【问题讨论】:
-
这可能是微不足道的,但是您是否尝试添加 `NUnit NuGet 包?