How to add a link to a VSTO project to a WiX installer project in Visual Studio 2010?

I have a Visual Studio 2010 solution that contains a VSTO add-in project. I also added a WiX Setup project for the solution, and now I need to add a link to the VSTO project in the Setup project, but I cannot do this. When I right-click the “Links” link in the “WiX Installation” project, then select “Add Link”, then select the “Projects” tab, the VSTO project will not appear in the list of available projects for the link.

+6
source share
1 answer

I had the same problem and tried to "do it wrong": I added a link to manually edit the .wixproj file.

I just had to add the following snippet:

<ItemGroup> <ProjectReference Include="..\MyExcelAddin\MyExcelAddin.csproj"> <Name>MyExcelAddin</Name> <Project>{2b1d7a7b-4928-45fa-bfdf-cd7d435eecfc}</Project> <Private>True</Private> <DoNotHarvest> </DoNotHarvest> <RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups> <RefTargetDir>INSTALLFOLDER</RefTargetDir> </ProjectReference> </ItemGroup> 

Obviously, you need to replace the path to your project and the project GUID (found in the assembly).

When you reload the project in Visual Studio (I use 2012, but I think it will be the same), you will see a link with a warning icon.

You can still use variables like $(var.MyExcelAddin.TargetDir) .

Hope this helps.

+2
source

All Articles