locked
Method 'CreateEditor' in type 'XXXX.TestStepEditorFactory' from assembly 'MMM.NNN, Version=UUUU, Culture=neutral, PublicKeyToken=null' does not have an implementation. RRS feed

  • Question

  • Hi,

    I created a custom test type in Visual Studio 2010. It works very well in visual studio 2010. And one of the calss inherits the Microsoft.VisualStudio.TestTools.EditorFactory. The VS package which implement the custome test type refer the assembly Microsoft.VisualStudio.ServiceModel.VisualStudioPackage, Microsoft.VisualStudio.ServiceModel, Version=10.0.0.0

    Now I deploy the VS package into Visual Studio 2012. I found the Visual Studio 2012 cannot load the package. The error message says: Method 'CreateEditor' in type 'XXXX.TestStepEditorFactory' from assembly 'MMM.NNN, Version=UUUU, Culture=neutral, PublicKeyToken=null' does not have an implementation.

    Does anyone see the similar issue or do you have any suggestions for this?


    • Edited by Tomas_Liu Wednesday, February 20, 2013 6:15 AM
    Wednesday, February 20, 2013 4:01 AM

Answers

  • I tried contacting some folks internally that might know about the test tools stuff (it is not owned by my team and I have no idea who owns it), I have not heard anything back. My initial investigation seems to indicate the the interfaces are defined in versioned assemblies (*sigh*), which means yes, you need distinct packages per VS target. Or you need to take care to isolate your code paths and switch up which objects you are using based on what VS you find yourself running in. That is tricky to do right and I know of no examples that would show the way.

    • Marked as answer by Tomas_Liu Friday, February 22, 2013 6:28 AM
    Friday, February 22, 2013 12:30 AM

All replies

  • Generally, with managed assemblies, if the interface/base class is defined in a versioned assembly you need to correctly reference the right version for the installed VS. The 'same' type in two different assemblies is not the same type as far as the CLR is concerned.
    Wednesday, February 20, 2013 5:32 AM
  • Thank you very much Ryan.

    So basically you are saying that we should reference the versioned assembly for the VS 2012 if the VS package is target to deploy into VS 2012.

    I.e.

    Microsoft.VisualStudio.ServiceModel.VisualStudioPackage, Microsoft.VisualStudio.ServiceModel, Version=11.0.0.0

    I tried that, the assembly above is built against .Net Framework 4.5, and I must build my VS package with .Net Framework 4.5. And then I found it works.

    If I want to deploy my VS package into VS 2010 on the machine that VS 2010 is installed, then I need to reference the version assembly (10.0.0.0). 

    If I want to deploy my VS package into VS 2012 on the machine that VS 2012 is installed, then I need to reference the version assembly (11.0.0.0).

    So I need to prepare two differents vs packages, from the souce code perspective, there are two similar vs packages project. One is build against .Net Framework 4.0, the other one is build against .Net Framework 4.0. One of them is for VS 2010, the other one is for VS 2012.

    Two different vs packages with similar code base except the dll reference and target framework is different. Just checking if there are any better solutions for this?

    Wednesday, February 20, 2013 6:42 AM
  • I tried contacting some folks internally that might know about the test tools stuff (it is not owned by my team and I have no idea who owns it), I have not heard anything back. My initial investigation seems to indicate the the interfaces are defined in versioned assemblies (*sigh*), which means yes, you need distinct packages per VS target. Or you need to take care to isolate your code paths and switch up which objects you are using based on what VS you find yourself running in. That is tricky to do right and I know of no examples that would show the way.

    • Marked as answer by Tomas_Liu Friday, February 22, 2013 6:28 AM
    Friday, February 22, 2013 12:30 AM
  • Thank you.
    Friday, February 22, 2013 6:30 AM