Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2012 - Exception has been thrown by the target of an invocation.

Simple project in Visual Studio 2012 is causing the following error when trying to load the test explorer:

------ Discover test started ------
Exception has been thrown by the target of an invocation.
========== Discover test finished: 1 found (0:00:00.152) ==========

This is my test project:

using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace MyApp
{
    [TestClass]
    public class MyTests
    {   
        [TestMethod]
        public void Test()
        {
            var foo = 1;
            Assert.AreEqual(1, foo);
        }
    }
}

The test explorer is not discovering my tests for some reason. Its probably down to the exception being raised at the top of my question. Does anyone know if this is a bug in Visual Studio 2012. Can't understand why something so simple is blowing it up?!?

like image 914
jaffa Avatar asked Apr 26 '13 09:04

jaffa


1 Answers

After installing SP3 for Visual Studio 2012, the error seemed to disappear.

like image 73
jaffa Avatar answered Oct 13 '22 06:10

jaffa