我正在尝试使用 Microsoft Expression Encoder 记录我的 Selenium 测试执行情况。我找到了很多关于我目前面临的问题的答案,但没有一个真正解决了这个问题。所以,我有一种方法可以开始视频录制过程。它很简单
scj = new ScreenCaptureJob();
scj.OutputScreenCaptureFileName = logPath + "\\" + fileName + ".wmv";
scj.ScreenCaptureVideoProfile.FrameRate = 25;
scj.CaptureMouseCursor = true;
scj.Start();
当我从 Visual Studio 2015 运行它时,它工作得非常好。但是当我在我们的一个构建代理中从 TeamCity 运行它时,我收到以下消息:
OneTimeSetUp: System.BadImageFormatException: Could not load file or assembly
'Microsoft.Expression.Encoder, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
or one of its dependencies. An attempt was made to load a program with an incorrect format
现在,对于我在一些论坛上阅读的内容,这与我的架构选择有关。在 TeamCity 中,编译代码的构建步骤选择了“任何 CPU”平台,而在 Visual Studio 中,选择了“混合平台”。
我已经尝试在 TeamCity 中将所有内容设置为 x86 架构,强制 NUnit 3 作为 32 位进程运行,并更改我的项目的目标架构。这些解决方案都没有奏效。有谁知道我还能做什么?