I have a CodedUI Test project in Visual Studio 2013. After following instructions for integrating SpecFlow with the CodedUI API, I'm getting the following error in the FeatureSetup
(Assembly binding logging was turned on)
Test Name: TheWelcomeScreen
Test FullName: (...)Feature.TheWelcomeScreen
Test Source: c:\path\to\My.feature : line 6
Test Outcome: Failed
Test Duration: 0:00:00
Result Message: Class Initialization method (...)Feature.FeatureSetup threw exception. System.IO.FileNotFoundException: System.IO.FileNotFoundException: Could not load file or assembly 'SpecFlow.Assist.Dynamic, Version=1.0.2.0, Culture=neutral' or one of its dependencies. The system cannot find the file specified.
=== Pre-bind state information === LOG: DisplayName = SpecFlow.Assist.Dynamic, Version=1.0.2.0, Culture=neutral (Partial) WRN: Partial binding information was supplied for an assembly: WRN: Assembly Name: SpecFlow.Assist.Dynamic, Version=1.0.2.0, Culture=neutral | Domain ID: 2 WRN: A partial bind occurs when only part of the assembly display name is provided. WRN: This might result in the binder loading an incorrect assembly. WRN: It is recommended to provide a fully specified textual identity for the assembly, WRN: that consists of the simple name, version, culture, and public key token. WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue. LOG: Appbase = file:///C:/Path/To/Current/TestResults/Directory/Out LOG: Initial PrivatePath = NULLCalling assembly : TechTalk.SpecFlow, Version=1.9.0.77, Culture=neutral, PublicKeyToken=0778194805d6db41. === LOG: This bind starts in default load context. LOG: Using application configuration file: C:\Path\To\Current\TestResults\Directory\Out\BWE.Tests.DLL.config LOG: Using host configuration file: LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config. LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind). LOG: Attempting download of new URL file:///C:/Path/To/Current/TestResults/Directory/Out/SpecFlow.Assist.Dynamic.DLL. LOG: Attempting download of new URL file:///C:/Path/To/Current/TestResults/Directory/Out/SpecFlow.Assist.Dynamic/SpecFlow.Assist.Dynamic.DLL. LOG: Attempting download of new URL file:///C:/Path/To/Current/TestResults/Directory/Out/SpecFlow.Assist.Dynamic.EXE. LOG: Attempting download of new URL file:///C:/Path/To/Current/TestResults/Directory/Out/SpecFlow.Assist.Dynamic/SpecFlow.Assist.Dynamic.EXE.
Result StackTrace:
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) at System.Reflection.Assembly.Load(String assemblyString) at TechTalk.SpecFlow.Infrastructure.BindingAssemblyLoader.Load(String assemblyName) at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext() at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection) at TechTalk.SpecFlow.Infrastructure.TestRunnerFactory.Create(Assembly testAssembly) at TechTalk.SpecFlow.TestRunnerManager.CreateTestRunner(TestRunnerKey key) at TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(TestRunnerKey key) at TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(Assembly testAssembly, Boolean async) at TechTalk.SpecFlow.TestRunnerManager.GetTestRunner() at (...)Feature.FeatureSetup(TestContext testContext) in c:\path\to\My.feature.cs:line 0
My packages.config
file for this solution:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AutoMapper" version="3.3.0" targetFramework="net40" />
<package id="CompareNETObjects" version="3.01.0.0" targetFramework="net40" />
<package id="ImpromptuInterface" version="6.2.2" targetFramework="net40" />
<package id="SpecFlow" version="1.9.0" targetFramework="net40" />
<package id="SpecFlow.Assist.Dynamic" version="1.0.2" targetFramework="net40" />
</packages>
In the "Properties" for the SpecFlow.Assist.Dynamic DLL, the CopyLocal
setting is set to true
. After building the solution, the bin\Debug
folder has SpecFlow.Assist.Dynamic.dll
in it, but the folder for the current test run in the TestResults
folder does not contain this DLL. It does contain these DLLs:
- The DLL for my project
- AutoMapper.dll
- KellermanSoftware.Compare-Net-Objects.dll
- TechTalk.SpecFlow.dll
I've opened and closed Visual Studio, uninstalled and reinstalled the NuGet package, deleted the package sources locally, cleaned, rebuilt, rebooted, manually removed the bin\Debug
folder and rebuilt... The list goes on. I'm still getting the same exception.