locked
Missing dll: Create unit tests crashes VS2010 before the dialogbox appears RRS feed

  • Question

  • Hi,

    Using VS2010 Professional (10.0.40219.1 SP1Rel)

    I have some projects where I can't initiate the "Create unit tests". VS crashes with no information. In event viewer I find this error for VSTTExecution: "(devenv.exe, PID 13204, Thread 1) TuipPackage.InitializeTestProjectPlugins: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.QualityTools.CodedUITestPackage, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies". I have checked and the file is (obviously) not in GAC.

    In general I have no problems with unit tests. It's just certain projects that behave this way. Now, after research it indicates that the missing file is not included in my Professional edition. But should that crash VS2010? I do not want to create any automated UI test or anything. I'm just trying to create a basic unit test. Somewhere in my project there is something that calls for UI testing (it's a class assembly btw).

    What could that be?

    --
    Werner











    Friday, June 24, 2011 8:43 AM

Answers

  • Alright, trial and error all night - really tired now. But I found the culprit and just wanted to share. As suspected this is not a very common scenario but here it goes: Remember that the exception I get is because VS tries to load a test DLL from the "automated UI tests" which I don't have on my PC - it is not part of VS2010 Professional. So this error is probably only reproducable if that DLL is missing (i.e. you are running VS2010 Professional).

    Create a new Classlibrary project and accept default values. Then insert the code below in the "Class1.cs" file:
    //
     
    using
    System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ClassLibrary1 { public class Class1 { public delegate void MyDelegate(MyDelegate inner); public int Add(int x, int y) { return x + y; } } public class MyList : List<Class1.MyDelegate> { } }

    Then right click in the "Add" method and select "Create Unit tests...". This makes VS2010 crash here. Very strange - even more strange that the exception is because it tries to load the "Microsoft.VisualStudio.QualityTools.CodedUITestPackage" assembly.
    .
    The problem here is that the "MyList" class inherits from "List<Class1.MyDelegate>". The delegate itself is not the problem but the inheritance is. As long as the delegate is defined as "MyDelegate(MyDelegate inner);" it will crash. If you instead change it to "MyDelegate(int inner);" then it works...Very strange error. Anyways, I thought I might share it so that noone else has to hunt down this error and upset the wife because you aren't sleeping...:)
    .
    Submitted to Connect.
    --
    Werner
     









    Wednesday, June 29, 2011 8:00 AM

All replies

  • Noone has a clue? Clearly it's an error that my VS2010 professional even tries to invoke a test that is not under it's license. But I can't wait until some future fix is issued (if ever). So I need to figure out what triggers that automated UI test. My assembly is simply too large for trial and error...

    My assembly doesn't seem to define anything that might be UI specific (e.g. it does not depend on system.windows.forms or anything like that). ANY suggestions are appreciated :).

    --
    Werner

     

    Tuesday, June 28, 2011 8:29 AM
  • Alright, trial and error all night - really tired now. But I found the culprit and just wanted to share. As suspected this is not a very common scenario but here it goes: Remember that the exception I get is because VS tries to load a test DLL from the "automated UI tests" which I don't have on my PC - it is not part of VS2010 Professional. So this error is probably only reproducable if that DLL is missing (i.e. you are running VS2010 Professional).

    Create a new Classlibrary project and accept default values. Then insert the code below in the "Class1.cs" file:
    //
     
    using
    System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ClassLibrary1 { public class Class1 { public delegate void MyDelegate(MyDelegate inner); public int Add(int x, int y) { return x + y; } } public class MyList : List<Class1.MyDelegate> { } }

    Then right click in the "Add" method and select "Create Unit tests...". This makes VS2010 crash here. Very strange - even more strange that the exception is because it tries to load the "Microsoft.VisualStudio.QualityTools.CodedUITestPackage" assembly.
    .
    The problem here is that the "MyList" class inherits from "List<Class1.MyDelegate>". The delegate itself is not the problem but the inheritance is. As long as the delegate is defined as "MyDelegate(MyDelegate inner);" it will crash. If you instead change it to "MyDelegate(int inner);" then it works...Very strange error. Anyways, I thought I might share it so that noone else has to hunt down this error and upset the wife because you aren't sleeping...:)
    .
    Submitted to Connect.
    --
    Werner
     









    Wednesday, June 29, 2011 8:00 AM