locked
How to implement Extending Work Item Tracking Context Menus? RRS feed

Answers

  • Hi Jess,

    Lets backtrack a bit here. This is an addin project, so you need to ensure the MyAddin1.AddIn file is copied over to your C:\Users\eddo\Documents\Visual Studio 2010\Addins directory.

    Then you need to open the C:\Users\eddo\Documents\Visual Studio 2010\Addins\Addin1.AddIn file, and ensure that the path to the assembly is correct. For example:

       <Assembly>c:\users\eddo\documents\visual studio 2010\Projects\MyAddin1\bin\MyAddin1.dll</Assembly>
    

    When you restart the Visual Studio IDE, you should see an entry for "ContextMenuAddin" (the friendly name specified for the addin). If it isn't loaded, check the box to the left of the entry to load the addin. If the menus are still not present, try the "devnev /resetaddin MyAddin1.Connect" again. (after existing all instances of VS first).

    The context menus should be there.

    Note, this is a really bad sample. MyAddin is a default name, so if you've used the wizard yourself, you probably already have a project with that name. The Friendly name in the .addin file "ContextMenuAddin" is a poor choice as well.

    As for a setup program. Yes, it is usually a good idea to have some sort of setup/install project for this, as you have to copy that .addin file to the VS 2010 addins directory.

    Sincerely,


    Ed Dore

    Tuesday, July 3, 2012 8:48 PM

All replies

  • Hi Jess,

    Thank you for your question.

    I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.

    Thank you for your understanding and support.

    Best regards,


    Lily Wu [MSFT]
    MSDN Community Support | Feedback to us

    Friday, June 29, 2012 4:16 AM
  • What do you mean by 'doesn't seem to work'? You may need to provide more details. The project doesn't compile?  It doesn't work at runtime? Which approach (AddIn or Package) are you taking?

    Ryan

    Friday, June 29, 2012 4:48 PM
  • Hi Jess,

    I tried downloading the zip, and was able successfully compile and run the project. The menu items were properly integrated into the experimental instance, and seem to work as advertised. Did you by chance install the Visual Studio SDK for VS 2010 SP1? That is a requirement for building packages. As Ryan mentioned, the more detailed your post, the better the chances someone can assist.

    Thanks,


    Ed Dore

    Friday, June 29, 2012 10:58 PM
  • It's the Addin that I'm working on. I successfully compiled the project with no errors. My problem is I already created a setup project and installed but I can't see it working because there are no added items in the context menus. Am I missing something here? Is installing the setup project enough to see the expected result?
    Monday, July 2, 2012 1:16 AM
  • Did you create a setup and install it? Yes, I already installed VS SDK SP1. I preferred using the Addin not the package because our requirement can be met by the Addin itself.

    Monday, July 2, 2012 1:18 AM
  • It seems that my problem is whether the addin is correctly loaded or not. Their is already an added equivalent item in the add-in manager and I was able to check the checkboxes but still I can't see the expected output.

    Monday, July 2, 2012 1:51 AM
  • Hi Jess,

    First, double check the MyAddin1.AddIn file under your C:\Users\<user>\Documents\Visual Studio 2010\Addins directory, and ensure the <Assembly> tag contains a valid path you your add-in assemly.

    The name "MyAddin1" is pretty generic, and the one you see in the Add-in Manager dialog may not be the one you think it is.

    Second, check out the implementation of connect.cs. Note that the commands are only added when that connectMode argument is set to ext_ConnectMode.ext_cm_UISetup. This is only ever passed on the first invocation of the addin, or when you force the IDE to reset the add-in with the following commandline:

       devenv /resetaddin MyAddin1.Connect

    Note, this is the same commandline we typically use when launching VS under the debugger for wizard generated add-in projects.

    Sincerely,


    Ed Dore

    Monday, July 2, 2012 6:33 PM
  • Ed,

    Thanks for your kind assistance!

    I already deleted the components in the addin folder. I reopen the project and compile it successfully. I compiled the setup project as well. Install it afterwards but the nothing happens. It seems that the component addin wasn't registered.

    Is it necessary to create a setup project for this?

    Tuesday, July 3, 2012 9:23 AM
  • Hi Jess,

    Lets backtrack a bit here. This is an addin project, so you need to ensure the MyAddin1.AddIn file is copied over to your C:\Users\eddo\Documents\Visual Studio 2010\Addins directory.

    Then you need to open the C:\Users\eddo\Documents\Visual Studio 2010\Addins\Addin1.AddIn file, and ensure that the path to the assembly is correct. For example:

       <Assembly>c:\users\eddo\documents\visual studio 2010\Projects\MyAddin1\bin\MyAddin1.dll</Assembly>
    

    When you restart the Visual Studio IDE, you should see an entry for "ContextMenuAddin" (the friendly name specified for the addin). If it isn't loaded, check the box to the left of the entry to load the addin. If the menus are still not present, try the "devnev /resetaddin MyAddin1.Connect" again. (after existing all instances of VS first).

    The context menus should be there.

    Note, this is a really bad sample. MyAddin is a default name, so if you've used the wizard yourself, you probably already have a project with that name. The Friendly name in the .addin file "ContextMenuAddin" is a poor choice as well.

    As for a setup program. Yes, it is usually a good idea to have some sort of setup/install project for this, as you have to copy that .addin file to the VS 2010 addins directory.

    Sincerely,


    Ed Dore

    Tuesday, July 3, 2012 8:48 PM