Microsoft Expression Encoder和Selenium + TeamCity

时间:2016-04-02 16:44:01

标签: c# selenium teamcity microsoft-expression

我试图用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位进程运行,并且还更改了我的项目的目标体系结构。这些解决方案都没有奏效。有没有人知道我还能做些什么?

1 个答案:

答案 0 :(得分:0)

You probably installed Microsoft.Expression.Encoder from its corresponding NuGet package.

You are also most likely not keeping your packages in source control (as it should be).

For that reason, when TC checks out the code the node packages are missing which requires a build step using the NuGet Installer, which will restore your packages before TC tries to build the code.

Teamcity NuGet Installer

相关问题