The tester does not show a list of device tests with a network drive

I had a simple C # program that had a Unit Tests suite. It was developed on Visual Studio 2010. Now on another computer, I tried to restart this solution using Visual Studio 2012 and run the tests. I was able to successfully restore the solution, however, none of the unit tests appeared in Test Explorer. The Visual Studio project (solution) was located on the LaCie Ethernet network drive. I copied the entire solution to my local C: drive, closed the solution from a network drive and reopened the copied file on the local C: drive. Now when I create the solution, Test Explorer shows all the tests. I came back and opened a copy on a network drive, and again Test Explorer does not show tests. It talks about building a solution in order to view a list of tests, but after successfully creating a solution that includes the main project and the unit test project, it still displays the same message. See image below: enter image description here

Why does he have a project located on a network drive that causes Unit Testing to fail like it does without an error message?

+4
source share
4 answers

Finally, we got this to work with a network resource 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.

+7
source

Rebuild all application projects, including any projects containing test classes and test methods. They will appear in Test Explorer.

OR

An attempt to change an asynchronous void to an asynchronous task.

how

 [TestMethod] public async Task<Customers> GetCustomers() { var result = await ... } 

Link: Unit Test Explorer does not display asynchronous module tests for metro applications

+3
source

The solution is actually only the first half of Gary:

 setx COMPLUS_LoadFromRemoteSources 1 

Additional information: http://connect.microsoft.com/VisualStudio/feedback/details/502353/running-unit-tests-from-network-drive

+2
source

With .Net 5 you need to add the test command to the project.json command list.

  "commands": { "web": "Microsoft.AspNet.Server.Kestrel --server.urls=http://localhost:5000", "test": "xunit.runner.dnx" }, 
0
source

Source: https://habr.com/ru/post/1436968/


All Articles