"Create Unit Tests" dialog shows no types


  • When I open a particular solution in VS2008, open a source file, right click on a public method, choose "Create Unit Tests", I get the "Create Unit Tests" dialog box, but the following things are wrong:

    1) No types are shown (the entire type area is blank)

    2) The "Output project" dropdown is not there (not blank or empty, the entire control is missing)

    3) If I click on "Settings" it closes the "Create Unit Tests" dialog box immediately.

    4) The OK button is greyed out (since no tests or project is chosen, I assume)


    This is just for a particular solution. That solution is quite large and I recently upgraded it from VS2005, The solution seems to work fine in all other respects. We now want to start using unit tests (which we did not with VS2005). But I cannot create any. Other people, using the same solution (checked out from the version control system), do not have this problem, they can add unit test to this solution using the "Create Unit Tests" dialog.

    The "Create Unit Tests" dialog box works for me too, on my machine, on other, newly created solutions.


    So, it seems that this is a problem particular to my machine and this solution. Unfortunately it is an essential solution and I am responsible for creating unit tests...


    Any idea what could be wrong?


    I am using Visual Studio Team System 2008 Development Edition. On the same computer I had already installed Visual Studio 2005 Team edition for Software Developers (and used the unit test tools in it) (and I have not uninstalled VS2005).

    I am running Windows Vista Ultimate 64 bit.

    One thing to note here is that I am the only one who previously had experimented with creating unit tests in VS2005. Can that somehow have registered unit testing settings that then corrupted the VS2008 installation?


    Thanks for any help,

    יום רביעי 02 יולי 2008 10:31

כל התגובות

  • Klas


    In VS2005, did you create unit test on an 32 bit machine? So far as I know, the Unit Test Framework is not supported for 64 bit apps. You can read this post. Sorry about that.

    יום שישי 04 יולי 2008 09:14
  • Klas


    We are changing the issue type to “Comment” because you have not followed up with the necessary information. If you have more time to look at the issue and provide more information, please feel free to change the issue type back to “Question”.

    יום שלישי 08 יולי 2008 09:50
  • I just tried creating my first unit test with VS2008 SP1 and I had the exact same issue.  The project I trying to create a unit test for is a brand new project with one class and one method in the class.  (The test project has a reference to my DLL)  Could this be a problem with SP1 beta?

    And also if I click "Add Assembly", the entire window closes and no error message is displayed.

    Here is a screen shot of what it looks like:
    יום חמישי 10 יולי 2008 20:32
  • Me too!


    I'm using VS2008 tead dev edition, RTM on server 2003 x64.

    Our main solution is huge, over 200 project, almost all of it native.  I've written some unit test projects using boost's test framework and wired them up to run trough their post-build events.  But I wanted to try the VS test tools.


    Completely bogus.  In a cut-down solution I can get test project created but the wizard won't run. I don't see any way to create a data driven test.  I can paste in the example code to make it run the boost test .exe and I can get the exit code to pass or fail the unit test.  So far, so good.


    But it only works if I hard-code the name of the output folder for the build into the test case.  That's not acceptable.  I could fix it by converting the native test code to a DLL I guess.


    Even with just 15 projects -- counting the test project, the three native boost test projects, and the units under test and their dependencies -- the GUI stops responding for minutes at a time.  But it eventually comes back.  I guess I can live with that too.


    But when I go back to my production solution and try to add existing project for the test project the GUI freezes forever.  It may not really be infinite -- the virus scan console shows the same few files outside the exclusion zones being reopened every few seconds -- mainly .tli and .tlh files in my per-user Temp folder.  But I went shopping and came back and it hadn't even tried to draw its title bar.  That I can't live with.


    at this point I have to agree with some of the other comments in this forum: this stuff may be acceptable to the pure managed code people who developed it and who are their intended audience but it does not come anywhere near meeting my needs.


    This is a shame -- the features and benefits are very attractive and I wish I could use it.  It just doesn't work.


    Based on some material I've seen in tonight's blog survey I'm going to try a clean install on a clean VM and see if it works any better.  My day-to-day machine has had a variety of beta software installed, deinstalled, and reinstalled and that may accound for it being a bit flakey.  But everything else in VS and TS is working.  Testing is, at a minimum, fragile.


    Oh well.


    שבת 26 יולי 2008 07:20
  • I am using VS2008 (v9 TRM) and I am experiencing similar problems. The dialog worked for a couple weeks and then suddenly stopped working. Since I rename all my test methods anyways I usually just delete the ones auto-generated so right-clicking and adding a new component (unit test) works fine for me.

    יום שני 28 יולי 2008 17:48
  • I had the same problem - Fixed it by uninstalling VS2008 SP1.
    Don't know if it worked before the SP as I've only just started exploring it.
    יום שישי 05 ספטמבר 2008 13:50
  • I had the exact same issue when I added a silverlight project into my solution. If I unload that project, "generate unit tests" works again. If I reload it stops working again, so the culprit in my case was definitely Silverlight.

    יום שלישי 16 ספטמבר 2008 18:10
  • I am experiencing the same behaviour.


    I am using VS2008 Team Edition SP1.


    I find that I get an empty list of types when creating a unit test if I have a Database Project in my solution. I have an SQL2008 database project using VSTSDB GDR CTP16.


    If I remove that project, the create unit test screen works fine. Not sure if it is a bug with VS2008 SP1 or with VSTSDB GDR CTP16

    יום רביעי 24 ספטמבר 2008 07:05
  • what to do from here. i've got the same issue. nothing showing. it's all a bit of a problem. i can't revert from sp1 as i am connecting to tfs 2008 app tier which hits a sql 2008 data tier. This is very frustrating... i have both a silverlight and a GDR app in my solution, so i'm going to setup a test solution and see where the problem kicks in for me, or if it's there from the get-go.

    stay posted.

    • נערך על-ידי acute mayhem יום רביעי 29 אוקטובר 2008 11:50
    יום שישי 24 אוקטובר 2008 12:58
  • oh...unless anyone already has a solution?
    • נערך על-ידי acute mayhem יום רביעי 29 אוקטובר 2008 11:50
    יום שישי 24 אוקטובר 2008 12:59
  • ok. i've just gone through this step by step, and:

    it is not a service pack 1 issue.
    it appears to happen if you have either a Silverlight or September CTP GDR SQL 2008 Database Project in your solution.

    if you remove the offending projects, you'll find that the problem "goes away" only to return after you re-add the project(s). So, the workaround is to remove offending projects before you create the tests, then create, then add back (i don't know if this will cause the tests to fail as i haven't actually tried running the tests).

    I've entered a bug into the connect site here (please vote/rate):

    Bug 377557

    Now, according to the VS Team at MS, it appears that the problem happens when there is a project whose output is not an assembly (see Bug 357452). I thought that would explain it, and it does in the case of the GDR project, however, it doesn't solve the silverlight mystery.

    If anyone hears anything on this keep me posted.

    • נערך על-ידי acute mayhem יום רביעי 29 אוקטובר 2008 11:50
    יום שישי 24 אוקטובר 2008 13:53
  • Ok Microsoft have gotten back to me with:

    We were able to reproduce the issue you are seeing. We are escalating this issue to the product unit who works on that specific feature area. The product team will review this issue and make a decision on whether they will fix it or not for the next release

    The bug is still active, so fingers crossed they do something about it soon. I'll keep posting here and on my blog for any updates, or you can just check the Connect bug.

    Edit: updated the "connect bug" link to point to the correct URL.

    Don't forget to click "Mark as Answer" on the post that helped you.
    • נערך על-ידי acute mayhem יום חמישי 06 נובמבר 2008 03:20
    יום רביעי 29 אוקטובר 2008 12:38
  • So, according to the Microsoft Connect bug this is going to be fixed in Hawaii. However, there's been no mention of 2008, but the issue remains active, which is a good sign.
    Get back to us irrespective of whether this post helps you.
    "Mark as Answer" if it helped you.
    Acute Jester - My Blog
    יום שלישי 25 נובמבר 2008 23:14
  • There is a KB available for this problem: http://code.msdn.microsoft.com/KB962866
    • הוצע כתשובה על-ידי CristianGhe יום חמישי 07 מאי 2009 11:24
    יום חמישי 07 מאי 2009 11:24
  • I have the same identical problem with Visual Studio 2008 Team System SP1 and it's not related to Silverlight for the simple reason that I have 1 solution with 10 .dll projects, in C# and nothing about SIlveright ...
    Starting from today if I add a Test Project on this Visual Studio solution, it works but then when I add a new unit test wizard the types are empty ... Until yesterday it was working and honestly, I didn't install anything today.
    The only changes I did were to rename the source folder in TFS ... but I didn't change the assemblies name or namespace in my solution.
    The update Microsoft released didn't solve my problem.
    It should be solved also in 2008 VS because this is a big issue as it is going to affect:
    1. My production
    2. My build procedures
    3. My code coverage
    It should not considered only for the 2010 version of VS as, for example, my Team is not going to upgrade to VS 2010 at the moment.

    MCAD - MCSD MCTS Sharepoint 2007 MCTS SQL Server 2005 http://blog.raffaeu.com "If my answer is useful remember to mark it as useful".
    יום שלישי 01 דצמבר 2009 14:38
  • Same here. The hotfix didn't sort the issue and unloading the Wix projects didn't help either.
    The idea of having to wait until VS 2010 is out is quite scary.
    יום שישי 19 פברואר 2010 11:40
  • I had the same problem so applied the fix, but now get:

    The following error was encountered while reading module System.Xml: Could not resolve type reference mscorlib SystemRuntime.CompilerServices.FriendAccessAllowedAttribute.

    Any ideas?


    שבת 03 אפריל 2010 18:15
  • This is a known issue, see this to fix: http://archive.msdn.microsoft.com/KB962866
    יום רביעי 28 דצמבר 2011 09:31
  • thank you, VS90SP1-KB962866-x86.exe fixed my problem.


    יום שלישי 11 ספטמבר 2012 16:23