6

我有一个包含 VSTO 加载项项目的 Visual Studio 2010 解决方案。我还在解决方案中添加了一个 WiX 安装项目,现在我需要在安装项目中添加对 VSTO 项目的引用,但我无法这样做。当我右键单击 WiX 设置项目中的引用,然后选择添加引用,然后选择项目选项卡时,VSTO 项目不会出现在要引用的可用项目列表中。

4

1 回答 1

2

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.

于 2013-04-29T13:16:40.840 回答