gpt4 book ai didi

c# - NUnit 错误 : "FrameworkName cannot have less than two components or more than three components"

转载 作者:行者123 更新时间:2023-11-30 12:55:30 26 4
gpt4 key购买 nike

我正在使用:

  • Visual Studio 2017 v15.5.4
  • NUnit 3.9.0
  • NUnit 测试适配器 3.9.0
  • Resharper 2017.3
  • .Net 4.7项目

尝试调试 NUnit 测试时出现随机异常:

首先是:

Managed Debugging Assistant 'BindingFailure' : 'The assembly with display name 'Microsoft.VisualStudio.QualityTools.VideoRecorderEngine' failed to load in the 'Load' binding context of the AppDomain with ID 1. The cause of the failure was: System.BadImageFormatException: Could not load file or assembly 'Microsoft.VisualStudio.QualityTools.VideoRecorderEngine' or one of its dependencies. The module was expected to contain an assembly manifest.'

其次是:

System.BadImageFormatException: 'Could not load file or assembly 'Microsoft.VisualStudio.QualityTools.VideoRecorderEngine' or one of its dependencies. The module was expected to contain an assembly manifest.'

和:

Managed Debugging Assistant 'BindingFailure' : 'The assembly with display name 'VSTestVideoRecorder' failed to load in the 'Load' binding context of the AppDomain with ID 1. The cause of the failure was: System.BadImageFormatException: Could not load file or assembly 'VSTestVideoRecorder' or one of its dependencies. An attempt was made to load a program with an incorrect format.'

继续出现一些相关异常后:

Managed Debugging Assistant 'LoadFromContext' : 'The assembly named 'nunit.engine.api' was loaded from 'file:///C:/Users/[Username]/AppData/Local/Temp/VisualStudioTestExplorerExtensions/NUnit3TestAdapter.3.9.0/build/net35/nunit.engine.api.DLL' using the LoadFrom context. The use of this context can result in unexpected behavior for serialization, casting and dependency resolution. In almost all cases, it is recommended that the LoadFrom context be avoided. This can be done by installing assemblies in the Global Assembly Cache or in the ApplicationBase directory and using Assembly.Load when explicitly loading assemblies.'

Managed Debugging Assistant 'LoadFromContext' : 'The assembly named 'Mono.Cecil' was loaded from 'file:///C:/Users/[Username]/AppData/Local/Temp/VisualStudioTestExplorerExtensions/NUnit3TestAdapter.3.9.0/build/net35/Mono.Cecil.DLL' using the LoadFrom context. The use of this context can result in unexpected behavior for serialization, casting and dependency resolution. In almost all cases, it is recommended that the LoadFrom context be avoided. This can be done by installing assemblies in the Global Assembly Cache or in the ApplicationBase directory and using Assembly.Load when explicitly loading assemblies.'

最后:

System.ArgumentException: 'FrameworkName cannot have less than two components or more than three components. Parameter name: frameworkName'

在那之后我可以调试我的测试,但是有新的随机异常 当我在调试 View 中传递一个集合时:

System.ArgumentNullException: 'Value cannot be null. Parameter name: collection'

使用 Stracktrace:

at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument) at System.Collections.Generic.Mscorlib_CollectionDebugView1..ctor(ICollection1 collection)

最佳答案

转到测试 -> 测试设置 -> 默认处理器架构。确保这与您当前的系统架构相匹配,即如果您的机器是 64 位,则将其设置为 X64,反之亦然:

enter image description here

关于c# - NUnit 错误 : "FrameworkName cannot have less than two components or more than three components",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48459750/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com