I've got a Visual Studio 2010 solution which contains a VSTO Add-In project. I've also added a WiX Setup project to the solution, and I now need to add a reference to VSTO project in the Setup project, but am unable to do so. When I right click the References in the WiX Setup project, then select Add Reference, then Select the Projects tab the VSTO project doesn't appear in the list of available projects to reference.
In Visual Studio, open your solution, and add a WiX project to it: go to the Visual Studio main menu and click File -> Add -> New Project to open the Add New Project dialog. Choose the Setup Project item in the Windows Installer XML node, specify the project name and click OK.
The Visual Studio WiX toolset allows you to easily create WiX projects, edit WiX files using IntelliSense, and compile/link your project within the Visual Studio IDE. For WiX project types, see WiX Project Types. For WiX item templates, see WiX Item templates.
I had the same problem, then I tried to "do it wrong": I added the reference editing the .wixproj file manually.
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 have to replace the path to your project and the project GUID (found in the assembly informations).
When you reload the project in Visual Studio (I use 2012 but I guess it'll be the same) you see the reference with a warning icon.
You still manage to use variables as $(var.MyExcelAddin.TargetDir)
though.
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With