visual-studio - 未解析对部分中符号 'WixComponentGroup:MyWebWebComponents' 的引用

标签 visual-studio wix wix3.8

我正在关注以下代码,即 product.wxs 文件。但我面临如下错误:

错误 5 未解析对“产品:{}”部分中的符号“WixComponentGroup:MyWebWebComponents”的引用

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
     xmlns:iis="http://schemas.microsoft.com/wix/IIsExtension">

  <Product Id="702881b5-9a64-4ab8-ab47-f3babcd950a2"
          Name="WixApplication" Language="1033"
          Version="1.0.0.0"
          Manufacturer="HexWireless"
          UpgradeCode="42b7872b-78c8-4a0b-abcd-28a30c9804ab">

    <Package InstallerVersion="200" Compressed="yes"  Platform="x64" InstallScope="perMachine"/>

    <!--<Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />-->

    <!--Find the Path to the sqlcmd.exe by performing a registry search. This is hardcoded for SQL 2012.
      Change 110 to 100 for 2008. Might need to change the script too.-->
    <Property Id="SQLBINDIR">
      <RegistrySearch Id="SqlBinDir"
        Root="HKLM" Key="SOFTWARE\Microsoft\Microsoft SQL Server\110\Tools\ClientSetup"
        Name="Path"
        Type="raw"
        Win64="yes"/>
    </Property>

    <Condition Message="Microsoft SQL Server 2012 needs to be installed before this installer can run">
      <![CDATA[SQLBINDIR]]>
    </Condition>

    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="INSTALLLOCATION" Name="Database">
        <Component Id="Database" Guid="a8dc2Fcd-087d-e393-b059-c67877e51b8a">
          <File Id="DatabaseScript" Source="SQLScripts\HexWireless.sql"/>
          <RemoveFile Id ="RemoveInstall.log" Name="Install.log" On="uninstall" />
        </Component>
      </Directory>

      <Directory Id="INSTALLDIR" Name="PFiles">
        <Directory Id="WixService" Name="Service">

            <Component Id="WixWindowsServiceComponent" DiskId="1" Guid="6f51c0f3-776c-4aec-a200-1f199352c6c3" Win64="yes">
              <File Id="WixService.exe" Name="WixService.exe" Source="$(var.WixService.TargetDir)\WixService.exe"/>
              <ServiceInstall Id="InstallWixService" DisplayName="WixService" Name="WixService.exe" Description="WixService" Account="NT Authority\Network Service" ErrorControl="normal" Start="demand" Type="ownProcess" Vital="yes" />
              <ServiceControl Id="ControlWixService" Name="WixService.exe" Stop="uninstall" Remove="uninstall" />
            </Component>
        </Directory>
      </Directory>

      <Directory Id="INSTALLFOLDER" Name="Publish">
      </Directory>

    </Directory>

    <Feature Id="ProductFeature" Title="WebApplication" Level="1">
      <Feature Id="Database" Title="Database" Description="DatabaseScript" Level="1" Display="expand"
               AllowAdvertise="no" ConfigurableDirectory="INSTALLLOCATION" Absent="allow">

        <Feature Id="WixWindowsServiceComponent" Title="Service" Description="WixService" Level="1" Display="expand"
              AllowAdvertise="no" ConfigurableDirectory="INSTALLDIR" Absent="allow">

          <ComponentGroupRef Id="WixWebsiteIssConfiguration" />
          <ComponentRef Id="Database"/>
          <ComponentRef Id="WixWindowsServiceComponent"/>
          <ComponentGroupRef Id="MyWebWebComponents"/>
        </Feature>
      </Feature>
    </Feature>

    <Property Id="INSTALLDIR" Value="D:" />
    <Media Id="1" Cabinet="WixWindowsServiceComponent.cab" EmbedCab="yes" />

    <InstallExecuteSequence>

      <!--If the database feature is selected these actions will run to install the DB-->
      <Custom Action="Database.cmd" After="InstallFiles" >
        <![CDATA[NOT Installed]]>
      </Custom>

      <!--Ensure this runs after the custom action to set up the properties for its cmd line-->
      <Custom Action="Database" After="Database.cmd">
        <![CDATA[NOT Installed]]>
      </Custom>

    </InstallExecuteSequence>

    <UI>
      <UIRef Id="GUI"/>
      <UIRef Id="WixUI_ErrorProgressText" />
    </UI>


    <!--This is the sequence script. Best way to understand this is by running sqlcmd -?
          Use "property" Custom action to get variable substitution working-->
    <CustomAction Id="Database.cmd"  Property="Database"
  Value="&quot;[SQLBINDIR]sqlcmd.exe&quot; -E -S &quot;[SQLSERVER]&quot; -i &quot;[#DatabaseScript]&quot; -o &quot;[INSTALLLOCATION]HexWireless.log&quot;"/>

    <!-- Note that the cmd line and args will come from a property with the same name as the custom action, this has been set by the custom action above -->
    <CustomAction Id="Database"  BinaryKey="WixCA"   DllEntry="CAQuietExec"   Return="check"   Execute="deferred"   Impersonate="yes"  />

  </Product>
</Wix>

提前致谢。

最佳答案

我不确定您的问题是否已解决,即使我使用 Wix 创建了其中一些 msi 文件,我也遇到了同样的问题。

就我而言,它没有找到我在项目中自动生成的“加热组件”。我不得不将此文件加载到项目中,(这些文件或文件夹可能在您的项目文件夹中,但在大多数情况下,VS 不会自动加载它们)。

您必须右键单击项目 -> 添加 -> 现有项目;并选择所需的文件/项目。

关于visual-studio - 未解析对部分中符号 'WixComponentGroup:MyWebWebComponents' 的引用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37699928/

相关文章:

wix - 如果先安装 MSI,然后安装包含 MSI 的 bundle ,则有两个 ARP 条目

c++ - Visual Studio 中的 "Additional Module Dependencies"和 "Additional BMI Directories"设置

c++ - 如何在 V4 打印机驱动程序中设置输出文件的固定目录

wix - 无法将 WixBundleProviderKey 变量传递给 msipackage

command-line - WiX Bootstrap : How do I set burn variables from the command line?

WiX:如何混合手动生成和自动生成的 .wxs 内容?

asp.net - 是否可以使用 Visual Studio Web 发布到 Azure Web App 来部署单个 aspx.cs 文件(Azure 运行时问题)

.net - NuGet 恢复包但缺少 DLL

visual-studio - 为什么wix项目会出错?

wix - 使用Heat进行收获时如何使用bind.FileVersion?