BadImageException:'无法加载文件或程序集'Microsoft.VisualStudio.QualityTools.VideoRecorderEngine'或其依赖项之一。

问题描述 投票:9回答:1

将Visual Studio 2017更新到15.5后,我无法再调试单元测试(我可以运行测试,我可以调试非测试程序)。

我一直得到以下例外情况:

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

Exception thrown: 'System.BadImageFormatException' in mscorlib.dll
Could not load file or assembly 'VSTestVideoRecorder' or one of its dependencies. An attempt was made to load a program with an incorrect format.

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

Exception thrown: 'System.BadImageFormatException' in mscorlib.dll
Could not load file or assembly 'VSTestVideoRecorder' or one of its dependencies. An attempt was made to load a program with an incorrect format.

Exception thrown: 'System.ArgumentException' in System.dll
FrameworkName cannot have less than two components or more than three components.

我已经确认每个项目都使用相同的编译器设置(7+ w /次要版本),并且都是针对.Net 4.7。除了将VS更新到15.5之外,有些文件中的代码根本没有改变。

我没有找到任何有关这些例外或如何解决它们的帮助。这看起来似乎是由VS更新引起的。

有任何想法吗?重新安装VS是唯一的解决方案吗?

visual-studio unit-testing
1个回答
0
投票

刚刚遇到同样的问题。

我开始寻找解决方案,在做了一些事情后,不知何故,问题得到解决。我所做的是:

  • 删除了所有我的%temp%文件夹(insane hum?
  • 评论了我的所有bindingRedirect和测试解决方案app.config(我需要)
  • 删除了我的packages文件夹的内容
  • 将我的Visual Studio 2017更新到最新版本(15.5.2)

不知道女巫步骤使其工作(或步骤的组合)。做了很多尝试。

瞧,它有效。

希望这对你有所帮助。

© www.soinside.com 2019 - 2024. All rights reserved.