Unit Testing over SMB in Visual Studio


Though I've recently upgraded computers, my old Drobo is still attached to the old machine, shared through Windows (SMB) with the new machine. I've been working on getting CS-RESP wrapped up in support of a Unity project, and wanted to start testing it.


After reading all the MSDN documentation I could on using the Test Explorer, I could not get the tests load for the life of me. I tried writing the test classes by hand, deleting them and generating a second time, restarting, you name it. Though common error cases were diligently called out on MSDN, my problem was not. Test Explorer remained empty, and I had no way of running my tests. Even Assert.AreEqual(1, 2); was passing...


As it turns out, it was the Drobo itself that was causing the problem. Or, more specifically, it was a problem with VisualStudio refusing to recognize tests within the shared folder. Bizarre. Perhaps more bizarre is the solution. The following environment variable is required:

setx COMPLUS_LoadFromRemoteSources 1

Run that line in Command Prompt, and your problem should be permanently solved.

While I didn't have the exact error this gentleman had, here's some more information: http://connect.microsoft.com/VisualStudio/feedback/details/502353/running-unit-tests-from-network-drive.

More Posts