C# 无法加载程序集';Microsoft.Expression.Encoder';或者它在类库项目中的一个依赖项进行单元测试

C# 无法加载程序集';Microsoft.Expression.Encoder';或者它在类库项目中的一个依赖项进行单元测试,c#,selenium-webdriver,nunit,expression-encoder,C#,Selenium Webdriver,Nunit,Expression Encoder,我需要使用selenium对我的web应用程序进行单元/集成测试,因此我需要记录屏幕。我已在全球设置和全球拆卸中记录如下: public void GlobalSetup() { SetupExtentReport(); // Create a instance of ScreenCaptureJob PropertiesCollection.Recorder = n

我需要使用selenium对我的web应用程序进行单元/集成测试,因此我需要记录屏幕。我已在全球设置和全球拆卸中记录如下:

    public void GlobalSetup()
            {
                SetupExtentReport();

                // Create a instance of ScreenCaptureJob
                PropertiesCollection.Recorder = new ScreenCaptureJob();

                // Specify the path & file name in which you want to save         
                PropertiesCollection.Recorder.OutputScreenCaptureFileName = @"C:\ScreenRecording.wmv";

                // Start the Screen Capture Job
                PropertiesCollection.Recorder.Start();

//remaining code
    }
在拆除中

    public void GlobalTearDown()
            {
                try
                {
                    //close extent reports
                    PropertiesCollection.ExtentReport.Flush();
                    PropertiesCollection.ExtentReport.Close();

                    //stop recorder
                    PropertiesCollection.Recorder.Stop();


                Console.WriteLine("Finished All Tests");
            }
}
但是我的测试没有调试,这个错误出现在测试资源管理器中

无法加载程序集“Microsoft.Expression.Encoder版本=4.0.0…”或者它的一个依赖项。试图加载格式不正确的程序

我一直在使用从已安装文件夹引用的表达式编码器程序集

注意:我的项目是简单类库项目

这是一个我看过的问题,但对我没有帮助:


我问了一些问题,但就我而言,这是一个库项目,无法转换为32位/64位,因为我不在IIS上。

我需要将构建平台目标从“任意CPU”更改为“x86”