Michael Stephenson

keeping your feet on premise while your heads in the cloud
posts - 257, comments - 277, trackbacks - 11

My Links

News

View Michael Stephenson's profile on BizTalk Blog Doc View Michael Stephenson's profile on LinkedIn

Twitter












Archives

Post Categories

Image Galleries

BizTalk

Mates

MsTest Command Line Referenced Assemblies

This was a small issue i came across the other day, just thought would add a note about it like i usually do.

Problem

When running my tests in visual studio everything is fine and they all pass.  In this particular case they were actually BizUnit tests where some of my steps use a proxy class which i have created and is in a seperate assembly.  In my assembly where i have my tests i have just added a reference even though my code does not directly use the assembly i reference.

The problem is when i run my tests of the command line using mstest.  I get an error that the proxy type can not be found and it turns out that the assembly containing it hasnt been copied to the test run folder where as when running them in the IDE it is copied.

Solution

The way i solved this was to add a deployment item to the test run config.  This will ensure the proxy assembly is copied to the folder regardless if the tests are ran from the command line or the IDE

Hope this saves someone a few minutes.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Print | posted on Friday, August 10, 2007 3:59 PM | Filed Under [ .net 2 ]

Feedback

Gravatar

# re: MsTest Command Line Referenced Assemblies

This definitely saved me a few minutes! In my case I was calling classes in one assembly, which loaded classes from another assembly using reflection. MSTest, trying to be too smart did not copy across the assemblies even though they are referenced in the test project.

I think this is a definite case of someone trying to be too clever - if it's referenced in my project, just copy it!

Unfortunately I found this after having spent roughly an hour trying to figure out why &"~@"£" MSTest would not copy my referenced assemblies or it would have saved me more time.

Thanks :-)
12/4/2007 6:54 PM | Dewang
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 
 

Powered by: