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

Kev*_*ter 9 unit-testing visual-studio

将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.
Run Code Online (Sandbox Code Playgroud)

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

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

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

bru*_*ida 0

刚刚遇到同样的问题。

\n\n

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

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

不知道具体的步骤(或步骤的组合)是否有效。做了很多尝试。

\n\n

瞧\xc3\xa0,它成功了。

\n\n

希望这对您有帮助。

\n