WixUIExtension.dll 无法加载

WixUIExtension.dll could not be loaded

我正在尝试制作一个 wix 安装程序。对于 Web 应用程序。

以下是我的wsx v3.11文件

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Product Id="Guid" Name="TestInstaller" Language="1033" Version="1.0.0.0" Manufacturer="CompanyName" UpgradeCode="Guid1">
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" Platform="x64" />

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
    <MediaTemplate EmbedCab="yes" />
    <PropertyRef Id="WIX_IS_NETFRAMEWORK_462_OR_LATER_INSTALLED"/>
    <Condition Message='This setup requires the .NET Framework 4.7 client profile installed.'>
      <![CDATA[Installed OR WIX_IS_NETFRAMEWORK_462_OR_LATER_INSTALLED]]>
    </Condition>
    <Feature Id="Complete" Title="TestInstaller" Description="TestInstaller" Level="1" ConfigurableDirectory='INSTALLFOLDER'>
      <ComponentGroupRef Id="ProductComponents" />
      <ComponentGroupRef Id="ProductBinComponents" />

    </Feature>


    <UIRef Id="WixUI_Mondo" />
    <UIRef Id="WixUI_ErrorProgressText" />
  </Product>

  <Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
     <Directory Id="INSTALLFOLDER" Name="Test Installer" >
        <Directory Id="INSTALLBINFOLDER" Name="bin">
        </Directory>
      </Directory>
    </Directory>
  </Fragment>

  <Fragment>
    <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
      <Component Id="ProductComponent" Win64="yes" Guid="*">
        <File Source="C:\Temp\Publish\Web.config" />
        <File Source="C:\Temp\Publish\NLog.config"/>
        <File Source="C:\Temp\Publish\Global.asax"/>
      </Component>
    </ComponentGroup>
    <ComponentGroup Id="ProductBinComponents" Directory="INSTALLBINFOLDER">
      <Component Id="ProductBinComponent" Win64="yes" Guid="*">
        <File Source="C:\Temp\Publish\bin\Antlr3.Runtime.dll"/>
        <File Source="C:\Temp\Publish\bin\Antlr3.Runtime.pdb"/>
      </Component>
    </ComponentGroup>
  </Fragment>
</Wix>

我的问题是我不知道这条错误消息是什么意思,也不知道如何解决它。

Either 'Microsoft.Tools.WindowsInstallerXml.AssemblyDefaultWixExtensionAttribute' was not defined in the assembly or the type defined in extension '..........\Program Files (x86)\WiX Toolset v3.11\bin\WixUIExtension.dll' could not be loaded.

1. RTF 许可文件:首先确保您已经创建了自己的 RTF 许可文件(使用写字板或类似工具),然后在您的 WiX 源中指定使用此 RTF 文件,如下所示:

<!-- Shown for context (one of several possible dialog sets): -->
<UIRef Id="WixUI_Mondo" /> 

<!-- The crucial variable that must be defined (for this dialog set): -->
<WixVariable Id="WixUILicenseRtf" Value="TestLicenseAgreement.rtf" />   

For more context and details, please see this example of what minimal tweaks are needed to a fresh WiX project to get it to compile (see inline comments in WiX markup towards bottom).


2。 Wix.dll:除了 WixUIExtensionWixNtFxExtension 之外,您可能还直接引用了 Wix.dll - 两者你需要保持包括在内。

So in other words: remove the project reference to Wix.dll and try to recompile.

如果这不起作用,请删除所有引用并仅重新添加 WixUIExtensionWixNtFxExtension


一些建议和链接:

  • 类似问题:Where do I find Microsoft.Tools.WindowsInstallerXml.dll?
  • 可能使用与临时目录不同的源路径。
  • 可能会从安装中排除 *.pdb 文件,除非您需要它进行调试。
  • Use one file per component。恕我直言,这可以防止各种问题。
  • 在发布之前从 WiX 源中删除您的 GUID - 或者它们可能被复制/粘贴。一点都不好