Why are all my Visual Studio test results “Not executed”

前端 未结 7 1274
-上瘾入骨i
-上瘾入骨i 2020-12-29 05:07

When I run my unit tests in my project I am seeing a result \"Not executed\" for every one. I have restarted my computer so I doubt this is some kind of hung process issue.

7条回答
  •  不知归路
    2020-12-29 05:41

    What a PITA! The IDE doesn't show any errors. In order to determine the error you have to do this

    1. Open the Visual Studio command prompt
    2. Change to the directory where the binary output of your test project is.
    3. Type mstest /testcontainer:The.Name.Of.Your.Test.Assembly.dll

    At the bottom of the output you will see the following text

    Run has the following issue(s):

    In my case it was the following:

    Failed to queue test run 'Peter Morris@PETERMORRIS-PC 2009-02-09 10:00:37': Test Run deployment issue: The location of the file or directory 'C:\SomePath\SomeProject.Tests\bin\Debug\Rhino.Mocks.dll' is not trusted.

    Now if VS had told me this in the IDE I could have fixed it in minutes! All you have to do is open Windows Explorer and find that DLL. Right-click on it and go to Properties. Then click the "Unblock" button.

    What a complete waste of my time!

提交回复
热议问题