masterkawaster
masterkawaster

Reputation: 199

Visual Studio 2012 Professional - unit tests not working

After building my application I get in the test output:

------ Discover test started ------

Exception has been thrown by the target of an invocation.

========== Discover test finished: 1 found (0:00:01,457) ==========

I'm using Visual Studio 2012 Professional on win7 32bit.

Tried:

  1. repairing vs2012
  2. reinstalling vs2012
  3. changing configurations
  4. changing path to

    Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll
    

Nothing worked...

Any ideas?

Previously I worked with Visual Studio 2010 Express edition.

Application is correct - I made just simple class library and test project just to be sure it works. And it doesn't. The same project works with my student premium version.

Upvotes: 9

Views: 7331

Answers (2)

DiligentKarma
DiligentKarma

Reputation: 5328

In my case, right clicking and selecting "Debug Tests" on a test method would not do anything. It was an existing test project. The issue was that the test project was not even included in the solution's build list. Somebody took it out from the solutions build list. Anytime I would select "Debug Tests", the projects were built but nothing happened.

Confirm that the test project is going to be built with the solution by right clicking on solution in the solution explorer, and then configuration manager. Ensure that the test project is checked-on for build. Those minor things that cause big problems!

Upvotes: 0

masterkawaster
masterkawaster

Reputation: 199

Ok

I looked again in http://connect.microsoft.com/visualstudio and tried also:

  1. moving project files to another location than default
  2. changing security rights in files and folders properties
  3. run vs as administrator

Nothing really worked until i found by chance vs2012 update 1 (under the "Additional Software" category)

After download and installation everything works fine.

Upvotes: 9

Related Questions