How do I add a reference to a VSTO project to a WiX Installer project in Visual Studio 2010?

梦想的初衷 提交于 2019-12-06 01:44:41

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/13844333/how-do-i-add-a-reference-to-a-vsto-project-to-a-wix-installer-project-in-visual

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!