Search code examples
c#visual-studio-2015vsixproject-template

Visual studio VSIX project, projecttemplate reference not found when the .vsix is installed


i'm currently working on a C# VSIX project. In the solution there is a VSIX-project with ItemTemplate files, and also a ProjectTemplate-project which outputs as a class library.

The ProjectTemplate-project references to a local .dll file, and the VSIX project references to the ProjectTemplate-project. When launching in the experimental instance everything works how it is supposed to, when making a release build and installing it on my own machine everything is still fine. When i install the .vsix file on another machine, all the templates can be added like they are supposed to but the project template cannot find the .dll reference anymore.

I don't have high enough rep to post an image but the error i get is the general missing directive or assembly reference. (errorcode: CS0246)

How do i keep the reference from breaking?

It's worth noting that the reference to the projectTemplate is done with the SideWaffle extension.

TL:DR: reference to local .dll-file in ProjectTemplate breaks after running the .vsix-file on another computer.

edit: So basically i want to have a way to also deploy the .dll-file on the target machine so the reference does not break. But I only want to need to send the .vsix-file


Solution

  • Thanks to @rene, this post: How to include VSIX output in it's package? and some fiddling around, I managed to get it to work. Set these VSIXProject properties to true:

    "Copy Build Output to Output Directory"
    "Copy Debug Symbols to Output Directory"
    "Include Assembly in VSIX Container"
    "Include Debug Symbols in Local Deployment"
    "Include Debug Symbols in SIX Container"

    Plus add the .dll file to your VSIX project AND the ProjectTemplate-Project. When running the .vsix on another machine it will add the .dll to the new project folder when creating it with the ProjectTemplate and set the right path property of the reference.