locked
Cannot create a unit test project. RRS feed

  • Question

  • When creating a new ASP.NET MVC 2 Web Application I want to create a Unit Test project by using the Create Unit Test Project window.  The window appears as it should and I select, “Yes, create a unit test project”, I use the default Test project name, and the Test framework that is selected is “Visual Studio Unit Test” (the only test framework available to me).  However, when I click OK to create the unit test, no unit test is created.  There is no Test Unit Project listed in my Solution Explorer.  If I look in the solution directory the directory for the unit test solution has been created but it is empty.

    I thought to check my options selection (Tools>Options) for Test Tools and when I selected Test Project I received a message stating, “An error occurred loading this property page”.

    Also, if I enable my Test View window (Test>Windows>Test View) and click on the Create New Test link I get “Visual Studios encountered a problem and is shutting down…” message box and VS shuts down.

    My guess is that I am missing some component of VS (or it got corrupted).  I am running Visual Studio 2010 Professional with SP1 on Windows 7.  My machine uses the i7 Core processor with 6G of memory.

    Any suggestions…

    Monday, September 26, 2011 10:27 PM

Answers

All replies

  • Hi,

    Try resetting the serrings http://msdn.microsoft.com/en-us/library/ms241273(v=vs.80).aspx or running in safe mode http://msdn.microsoft.com/en-us/library/ms241278(v=vs.80).aspx

    Thanks,

    Anuj


    http://www.anujchaudhary.com/
    Tuesday, September 27, 2011 5:33 AM
  • Hello Anuj,

    I tried resetting the settings and running in safe mode as you suggested. The problem still exist as stated previously.

    Any other suggestions would be appreciated.

     

    Thank you,

    Ken

    Tuesday, September 27, 2011 1:01 PM
  • This morning I performed a Maintenance Installation (I hope that is the correct term) in the hope that it would correct any file and/or registry problems.  No luck, the problem remains the same.

    I then ran VS with the /log parameter hoping to identify any errors.  The errors I received are as follows:

      <entry>

        <record>251</record>

        <time>2011/09/28 14:38:41.373</time>

        <type>Error</type>

        <source>VisualStudio</source>

        <description>SetSite failed for package [Microsoft.VisualStudio.TestTools.Tips.TuipPackage.TuipPackage, Microsoft.VisualStudio.QualityTools.Tips.TuipPackage, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]</description>

        <guid>{52CBD135-1F97-2580-011F-C7CD052E44DE}</guid>

        <hr>80070057 - E_INVALIDARG</hr>

        <errorinfo>The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))</errorinfo>

      </entry>

      <entry>

        <record>280</record>

        <time>2011/09/28 14:38:49.597</time>

        <type>Error</type>

        <source>VisualStudio</source>

        <description>SetSite failed for package [Microsoft.VisualStudio.TestTools.Tips.TuipPackage.TuipPackage, Microsoft.VisualStudio.QualityTools.Tips.TuipPackage, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]</description>

        <guid>{52CBD135-1F97-2580-011F-C7CD052E44DE}</guid>

        <hr>80070057 - E_INVALIDARG</hr>

        <errorinfo>Value does not fall within the expected range.</errorinfo>

      </entry>

      <entry>

        <record>317</record>

        <time>2011/09/28 14:39:00.173</time>

        <type>Error</type>

        <source>VisualStudio</source>

        <description>SetSite failed for package [Microsoft.VisualStudio.TestTools.Tips.TuipPackage.TuipPackage, Microsoft.VisualStudio.QualityTools.Tips.TuipPackage, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]</description>

        <guid>{52CBD135-1F97-2580-011F-C7CD052E44DE}</guid>

        <hr>80131500</hr>

        <errorinfo>Failed to get service Microsoft.VisualStudio.TestTools.Vsip.ITestProjectService.</errorinfo>

      </entry>

      <entry>

        <record>318</record>

        <time>2011/09/28 14:39:00.175</time>

        <type>Error</type>

        <source>VisualStudio</source>

        <description>End package load [Microsoft.VisualStudio.TestTools.Tips.TuipPackage.TuipPackage, Microsoft.VisualStudio.QualityTools.Tips.TuipPackage, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]</description>

        <guid>{52CBD135-1F97-2580-011F-C7CD052E44DE}</guid>

        <hr>80131500</hr>

        <errorinfo>Failed to get service Microsoft.VisualStudio.TestTools.Vsip.ITestProjectService.</errorinfo>

      </entry>

     Any help would be appreciated.

    Wednesday, September 28, 2011 3:24 PM
  • Hello Ken,

    Are you able to create a Test Project via File-> New Project or via Test Menu->New Test?

    Can you file a connect bug (http://connect.microsoft.com/VisualStudio). I would like to loop in our engineers on this.

     

    Thanks,

    Abhishek Agrawal

    Program Manager, Visual Studio

    Microsoft

    Thursday, September 29, 2011 9:39 AM
  • I have the same problem in VS 2012 Pro RTM. Here is a bug report: http://connect.microsoft.com/VisualStudio/feedback/details/759763/cannot-create-or-open-a-unit-test-project-in-vs-2012-pro#details
    Monday, August 27, 2012 2:50 PM