Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Test Explorer Not Showing List of Unit Tests with Network Drive

I had a simple C# program that had a set of Unit Tests. This was developed on Visual Studio 2010. Now on another computer I tried to reload this solution with Visual Studio 2012 and run the tests. I was able to rebuild the solution successfully however none of the unit tests show up in Test Explorer. The Visual Studio project (solution) was located on a LaCie Ethernet network drive. I copied the entire solution to my local C: drive, closed the solution from the network drive and reopened the copied one on local C: drive. Now when I build solution Test Explorer shows all tests. I went back and opened the copy on the network drive and again Test Explorer shows no tests. It says to build the solution to see a list of tests, but after successfully building the solution which includes the main project and the unit test project it still displays the same message. See image below: enter image description here

Why is it having project located on network drive causes Unit Testing to fail like this with no failure message at all?

like image 985
JonN Avatar asked Dec 15 '22 19:12

JonN


1 Answers

We finally got this to work on a network share using the following commands:

setx COMPLUS_LoadFromRemoteSources 1

caspol -m -ag 1.2 -url file://<path>* FullTrust

For example, if the path is \\computer\share\, then the second command will be:

caspol -m -ag 1.2 -url file://\\computer\share\* FullTrust

(note the asterisk at the end of the path)

Close VS first, run the commands, restart VS. This worked for me without having to clean/build my project.

like image 123
Gary Avatar answered Apr 30 '23 02:04

Gary