Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2010 - no tests were run because no tests are loaded or the selected tests are disabled

I have a problem which has received plenty of attention which, despite much googling, I have been unable to resolve. I have a Test Project attached to my Visual Studio 2010 MVC 2 Application. When I attempt to run my tests, I get:

"no tests were run because no tests are loaded or the selected tests are disabled."

Following this, I followed the instructions in these posts, to no avail:

  • MSTest: No tests are run because no tests are loaded or the selected tests are disabled = my GUIDs are right, and the assembly IS being built - I can see the file in explorer.
  • MSTest Not Finding New Tests = reopening the solution & rebuilding didn't result in any change
  • http://richallen.blogspot.com/2008/05/ms-test-re-enabling-ignored-tests.html = the tests do not even appear in the test list browser under "loaded tests"

Furthermore, the output console reports:

"Could not load file or assembly 'file://\shared\shared\IT\Development\TPS\TPS.Tests\bin\Debug\TPS.Tests.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)"

I have confirmed the build settings on the Test Project are the same as those for the main project (Any CPU targeted).

Therefore, is it a problem accessing the resource over network share? Otherwise, does anyone have a suggestion?

like image 741
Hanshan Avatar asked Oct 21 '10 01:10

Hanshan


2 Answers

If you want to continue using a network share to host assemblies in .NET 4, you can change a Visual Studio configuration option to grant those assemblies full trust. You need to edit C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.config and add the following line:

<loadFromRemoteSources enabled="true"/>

To the configuration/runtime element. This is described in (slightly) more detail at http://msdn.microsoft.com/en-us/library/dd409252%28VS.100%29.aspx. I would not recommend making this change without understanding the security implications of doing so, some of which are outlined in that MSDN article.

In general, though, I agree with the previous answer. Hosting Visual Studio projects on a network share is going to create a large number of problems for very little benefit.

like image 169
Sean Kleinjung Avatar answered Nov 03 '22 20:11

Sean Kleinjung


Having your source code on a share is plain wrong (period) and will lead to all sorts of 'gremlins'.

Do yourself a favour, use Source Code Control and have a local copy of the source code. You will waste a lot less time, and as a bonus you will be able to track who changed what.

If you go with TFS, the Visual Studio TFS Branching Guide 2010 is a valuable resource.

If you use SubVersion, then the Red Bean Book is excellent.

like image 8
Mitch Wheat Avatar answered Nov 03 '22 21:11

Mitch Wheat