Politics, Weather, Photography, and the Dog
Friday 7 March 2014

One of my tasks at my day job today is to get continuous integration running on a Jenkins server. It didn't take too long to wrestle MSBuild to the ground and get the build working properly, but when I added an MSTest task, a bunch of unit tests failed with this error:

System.IO.FileNotFoundException: Could not load file or assembly 'System.Web.Providers, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

The System.Web.Providers assembly is properly referenced in the unit test project (it's part of a NuGet package), and the assembly's Copy Local property is set to True.

When the unit tests run from inside Visual Studio 2013, they all work. When ReSharper runs them, they all work. But when I execute the command line:

MSTest.exe /resultsfile:MSTestResults.trx /testcontainer:My.Stupid.Test\bin\My.Stupid.Test.dll /test:MyFailingTest

...it fails with the error I noted above.

I'll spare you the detective work, because I have to get back to work, but I did find the solution. I marked the failing test with a DeploymentItemAttribute:

public void MyFailingTest()

Now, suddenly, everything works.

And people wonder why I hate command line crap.

Friday 7 March 2014 14:15:00 CST (UTC-06:00)  |  | Software#
On this page....
Could not find assembly in command-line MSTest execution
The Daily Parker +3616d 13h 19m
Whiskey Fest 21d 20h 24m
My next birthday 331d 09h 48m
Parker's 10th birthday 250d 23h 54m
Aviation (380) Baseball (114) Best Bars (10) Biking (46) Chicago (1039) Cubs (199) Duke (134) Geography (385) Higher Ground (5) Jokes (284) Kitchen Sink (743) London (86) Parker (207) Daily (204) Photography (171) Politics (312) US (1185) World (297) Raleigh (21) Readings (8) Religion (69) San Francisco (96) Software (235) Blogs (93) Business (263) Cloud (96) Cool links (157) Security (113) Travel (302) Weather (781) Astronomy (108) Windows Azure (65) Work (112) Writing (15)
<October 2015>
Full archive
David Braverman and Parker
David Braverman is the Chief Technology Officer of Holden International in Chicago, and the creator of Weather Now. Parker is the most adorable dog on the planet, 80% of the time.
All content Copyright ©2015 David Braverman.
Creative Commons License
The Daily Parker by David Braverman is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 United States License, excluding photographs, which may not be republished unless otherwise noted.
Admin Login
Sign In
Blog Stats
Total Posts: 4989
This Year: 375
This Month: 11
This Week: 7
Comments: 0