Search code examples
visual-studiovisual-studio-2017visual-studio-extensionsvsix

How can you create a Visual Studio extension that references a class library project?


I'm having an issue creating a Visual Studio Extension that calls into another project. I've put a trivial example up on github: https://github.com/craigguest/HelloWorldVSIX

In this example I simply have a "Invoke HelloWorld Command" item in the tools menu that gets it's message from a static property in another project (Message.Text). However, I get this error when clicking the item:

VS 2017 Extension Error Message

I have added the project as an asset in the manifest, and added the ProvideBindingPath attribute to my package class but I still get the error.

Anything you can do to help would be appreciated, not much is turning up in searches.


Solution

  • You need to sign your class library project with package project key.snk.

    right click project named HelloWorld -> Properties -> signing -> enable sign the assembly -> click the dropdownlist below -> Browser... -> select key.snk file in the project named HelloWorld2Parter -> Open -> rebuild your project.

    enter image description here