开发者

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 n开发者_如何转开发o 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?


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.


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.


I was running all local but still had the problem. I found that what caused it was removing an xml tag during manual editing.

add:

CodedUITest() inside of tag brackets

on the line immediately above your class where all your test methods are.

add:

TestMethod() inside of tag brackets

on the line immediately above your test methods you want to run.

build project and run.


I tried the following steps while encountering this problem and luckily the issue got resolved...

  1. Close the solution and open the empty VS editor and Check out the testrunconfig file
  2. Open the solution and under CodeCOverage column, uncheck and check the dll's available( these dll's would be having a warning symbol)
  3. Rebuild the solution and now run the test cases.

Hope this resolves the issue... :)


I struggled with this for days, and didn't find the answer (for my situation) anywhere, so though I'd jot down my experience...

So I had the same problem, doing what I thought was local testing on a test project created locally.. (I'm a novice...) but returning the same error mentioned above : /

Anyway it seems that VS2010 had by default placed my project dir within the library folder, which was classified as network, subsequently all files within were 'unavailable offline'.

By moving my project dir to c:// my project files became index-able. (much to my relief!)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜