views:

223

answers:

2

rig: win7 64bit, vs2010, mvc v2, TestDriven.Net 3.0, Reshaper 5.0, MSpec 0.3

i recently started a new project and want to use mspec.

(1) copied Machine.Specifications.ReSharperRunner.5.0.dll and Machine.Specifications.dll to JetBrains\ReSharper\5.0\Bin\Plugins\Machine.Specifications (2) copied Machine.Specifications.TDNetRunner.dll to TestDriven.NET 3\Machine.Specifications

when i try to run the test i get this error: System.IO.FileNotFoundException: Could not load file or assembly 'Machine.Specifications

i don't know where this error is coming from.

vs2010 menu -> ReSharper ->Plugins shows the MSpec plugin. vs2010 menu ->ReSharper -> Options -> Tools -> Unit Testing also shows the MSpec unit testing provider but it doesn't show any details when i click on it as does MSTest and nUnit.

i found this: http://marcinobel.com/index.php/mspec-bdd-installer/ which didn't work. i also tried this: http://eduncan911.com/blog/registering-mspec-runners-for-testdriven-net-on-windows-x64.aspx which also didn't work. now i fear i screwed my registry.

any guidance?

full error:

Test 'F:Tests.OTBRadio.Tasks.AlbumTasksSpecs.when_the_album_tasks_are_asked_to_get_all.context' failed: Could not load file or assembly 'Machine.Specifications, Version=0.3.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. System.IO.FileNotFoundException: Could not load file or assembly 'Machine.Specifications, Version=0.3.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. File name: 'Machine.Specifications, Version=0.3.0.0, Culture=neutral, PublicKeyToken=null' at Machine.Specifications.TDNetRunner.SpecificationRunner.RunMember(ITestListener testListener, Assembly assembly, MemberInfo member) at TestDriven.TestRunner.AdaptorTestRunner.Run(ITestListener testListener, ITraceListener traceListener, String assemblyPath, String testPath) at TestDriven.TestRunner.ThreadTestRunner.Runner.Run()

+1  A: 

You do not need to copy Machine.Specifications.TDNetRunner.dll anywhere, just place it in your project's tools or lib directory, i.e. where you keep your project's dependencies. The project containing the MSpec tests will reference the Machine.Specifications.dll from this directory. TestDriven.Net >=2.24 will be able to pick up the TD.Net runner as long as Machine.Specifications.dll.tdnet is located in the same directory. An example how I like to organize my tools directory can be found here.

Your ReSharper 5.0 plugin directory looks good to me. However, I've had users reporting that when you unzip the MSpec zip file (that you likely downloaded from http://teamcity.codebetter.com) using Explorer, Windows marks the extracted DLLs as being downloaded from the Internet.

Can you please make sure that Windows does not block the DLLs in <ReSharper 5.0>\bin\plugins by opening each DLL's properties and clicking "Unblock" on the first property page. In case the "Unblock" button is not displayed, your files are okay. In that case, please post here and we'll see how we can your MSpec plugin working.

Alexander Groß
i've got a similar "ReferencedAssemeblies" directory for my project. i did everything your suggested, still not working. i added the full error to my original posting as it won't fit here.
CurlyFro
Can you please try to use Process Monitor to see if Machine.Specifications.dll cannot be located while running the test? As another option, try to build your test assembly as x86. Does the ReSharper runner work for you?
Alexander Groß
i got frustrated and started a fresh project and it worked. thanks for your help.
CurlyFro
I'm glad you got it working!
Alexander Groß
A: 

After changing any dll you should clean up project - so you don't have any errors in fresh project.

awattar