无法加载Wix托管主机

我已经制作了一个超级简单的wix引导程序并在Visual Studio 2015中安装项目(并在2013年尝试了相同的结果).引导程序将发布一个消息框并退出,但是我收到错误“加载必备引导程序应用程序,因为无法加载托管主机,错误:0x80070490.”我不知道错误代码的含义.

它正在尝试安装已存在的.Net 4.5,然后退出.

我确实有用于程序集的BootstrapperApplicationAttribute,它指向正确的类. bootstrapper应用程序是.Net 4.5 WPF用户控件库.

这是完整的日志
编辑:最新日志与最近的更改

[3AB8:2C8C][2015-09-10T14:44:59]i001: Burn v3.10.0.2026, Windows v6.3 (Build 9600: Service Pack 0), path: E:\Projects\WpfApplication1\Bootstrapper1\bin\Release\Bootstrapper1.exe
[3AB8:2C8C][2015-09-10T14:44:59]i009: Command Line: '/log log.txt'
[3AB8:2C8C][2015-09-10T14:44:59]i000: Setting string variable 'WixBundleLog' to value 'E:\Projects\WpfApplication1\Bootstrapper1\bin\Release\log.txt'
[3AB8:2C8C][2015-09-10T14:44:59]i000: Setting string variable 'WixBundleOriginalSource' to value 'E:\Projects\WpfApplication1\Bootstrapper1\bin\Release\Bootstrapper1.exe'
[3AB8:2C8C][2015-09-10T14:44:59]i000: Setting string variable 'WixBundleOriginalSourceFolder' to value 'E:\Projects\WpfApplication1\Bootstrapper1\bin\Release\'
[3AB8:2C8C][2015-09-10T14:44:59]i000: Setting string variable 'WixBundleName' to value 'Bootstrapper1'
[3AB8:2C8C][2015-09-10T14:44:59]i000: Setting string variable 'WixBundleManufacturer' to value 'Myself'
[3AB8:2C8C][2015-09-10T14:44:59]i000: Loading prerequisite bootstrapper application because managed host could not be loaded, error: 0x80070490.
[3AB8:3C74][2015-09-10T14:44:59]i000: Setting numeric variable 'WixStdBALanguageId' to value 1033
[3AB8:3C74][2015-09-10T14:44:59]i000: Setting version variable 'WixBundleFileVersion' to value '1.0.0.0'
[3AB8:2C8C][2015-09-10T14:44:59]i100: Detect begin, 2 packages
[3AB8:2C8C][2015-09-10T14:44:59]i000: Setting string variable 'NETFRAMEWORK45' to value '393297'
[3AB8:2C8C][2015-09-10T14:44:59]i102: Detected related bundle: {14998a68-ae2d-4209-b77e-a3f04dd57a37}, type: Upgrade, scope: PerMachine, version: 1.0.0.0, operation: None
[3AB8:2C8C][2015-09-10T14:44:59]i102: Detected related bundle: {1e5997c3-1ce9-4ba9-b0dd-8b23dbc2ae5b}, type: Upgrade, scope: PerMachine, version: 1.0.0.0, operation: None
[3AB8:2C8C][2015-09-10T14:44:59]i102: Detected related bundle: {464b46a0-9c95-4a9a-a09c-cc05eabded4e}, type: Upgrade, scope: PerMachine, version: 1.0.0.0, operation: None
[3AB8:2C8C][2015-09-10T14:44:59]i102: Detected related bundle: {5b9e54c5-39fe-4438-9d7a-5d97ace1a57f}, type: Upgrade, scope: PerMachine, version: 1.0.0.0, operation: None
[3AB8:2C8C][2015-09-10T14:44:59]i102: Detected related bundle: {5e80916f-30ff-4791-97df-a503198504c5}, type: Upgrade, scope: PerMachine, version: 1.0.0.0, operation: None
[3AB8:2C8C][2015-09-10T14:44:59]i102: Detected related bundle: {6c9fdff8-7e6b-4365-8509-18fc5394599e}, type: Upgrade, scope: PerMachine, version: 1.0.0.0, operation: None
[3AB8:2C8C][2015-09-10T14:44:59]i102: Detected related bundle: {97cba9a5-0ec5-40cc-ac89-30e790e81755}, type: Upgrade, scope: PerMachine, version: 1.0.0.0, operation: None
[3AB8:2C8C][2015-09-10T14:44:59]i102: Detected related bundle: {b4cc8c31-ee10-4566-a13d-7a8ab7c77ea9}, type: Upgrade, scope: PerMachine, version: 1.0.0.0, operation: None
[3AB8:2C8C][2015-09-10T14:44:59]i102: Detected related bundle: {d51bb1d2-e28b-467d-ac56-7dcf93a9b838}, type: Upgrade, scope: PerMachine, version: 1.0.0.0, operation: None
[3AB8:2C8C][2015-09-10T14:44:59]i102: Detected related bundle: {fc6f26ca-2fa0-426d-acdb-bb350bc7a3db}, type: Upgrade, scope: PerMachine, version: 1.0.0.0, operation: None
[3AB8:2C8C][2015-09-10T14:44:59]i052: Condition 'NETFRAMEWORK45 >= 378389' evaluates to true.
[3AB8:2C8C][2015-09-10T14:44:59]i101: Detected package: NetFx45Redist, state: Present, cached: None
[3AB8:2C8C][2015-09-10T14:44:59]i101: Detected package: SetupProject1.msi, state: Absent, cached: None
[3AB8:2C8C][2015-09-10T14:44:59]i199: Detect complete, result: 0x0
[3AB8:2C8C][2015-09-10T14:45:03]i500: Shutting down, exit code: 0x642
[3AB8:2C8C][2015-09-10T14:45:03]i000: The prerequisites were already installed. The bootstrapper application will not be reloaded to prevent an infinite loop.
[3AB8:2C8C][2015-09-10T14:45:03]i410: Variable: NETFRAMEWORK45 = 393297
[3AB8:2C8C][2015-09-10T14:45:03]i410: Variable: WixBundleAction = 5
[3AB8:2C8C][2015-09-10T14:45:03]i410: Variable: WixBundleElevated = 0
[3AB8:2C8C][2015-09-10T14:45:03]i410: Variable: WixBundleFileVersion = 1.0.0.0
[3AB8:2C8C][2015-09-10T14:45:03]i410: Variable: WixBundleInstalled = 0
[3AB8:2C8C][2015-09-10T14:45:03]i410: Variable: WixBundleLog = E:\Projects\WpfApplication1\Bootstrapper1\bin\Release\log.txt
[3AB8:2C8C][2015-09-10T14:45:03]i410: Variable: WixBundleManufacturer = Myself
[3AB8:2C8C][2015-09-10T14:45:03]i410: Variable: WixBundleName = Bootstrapper1
[3AB8:2C8C][2015-09-10T14:45:03]i410: Variable: WixBundleOriginalSource = E:\Projects\WpfApplication1\Bootstrapper1\bin\Release\Bootstrapper1.exe
[3AB8:2C8C][2015-09-10T14:45:03]i410: Variable: WixBundleOriginalSourceFolder = E:\Projects\WpfApplication1\Bootstrapper1\bin\Release\
[3AB8:2C8C][2015-09-10T14:45:03]i410: Variable: WixBundleProviderKey = {0112e2c7-f979-4afe-a3fd-6be0231f6727}
[3AB8:2C8C][2015-09-10T14:45:03]i410: Variable: WixBundleTag = 
[3AB8:2C8C][2015-09-10T14:45:03]i410: Variable: WixBundleVersion = 1.0.0.0
[3AB8:2C8C][2015-09-10T14:45:03]i410: Variable: WixStdBALanguageId = 1033
[3AB8:2C8C][2015-09-10T14:45:03]i007: Exit code: 0x642, restarting: No

编辑:这是BootstrapperApplicationRef部分.我已经尝试过使用和不使用BootstrapperCore.dll和Microsoft.Deployment.WindowsInstaller.dll.除了标准的.Net库之外,bootstrapper应用程序没有其他依赖项

<BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost">
  <Payload Name='BootstrapperCore.config' SourceFile="..\VerySimpleBurnApp\VerySimpleBurnApp.BootstrapperCore.config"/>
  <Payload SourceFile="..\VerySimpleBurnApp\bin\Release\VerySimpleBurnApp.dll"/>
  <Payload SourceFile="..\VerySimpleBurnApp\bin\Release\BootstrapperCore.dll"/>
  <Payload SourceFile="..\VerySimpleBurnApp\bin\Release\Microsoft.Deployment.WindowsInstaller.dll"/>
</BootstrapperApplicationRef>

和VerySimpleBurnApp.BootstrapperCore.config
编辑:更新为当前

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <sectionGroup name="wix.bootstrapper" type="Microsoft.Tools.WindowsInstallerXml.Bootstrapper.BootstrapperSectionGroup, BootstrapperCore">
      <section name="host" type="Microsoft.Tools.WindowsInstallerXml.Bootstrapper.HostSection, BootstrapperCore" />
    </sectionGroup>
  </configSections>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
  </startup>
  <wix.bootstrapper>
    <host assemblyName="VerySimpleBurnApp">
      <supportedFramework version="v4.5" />
    </host>
  </wix.bootstrapper>
</configuration>

最佳答案 对于.NET 4.5,supportedRuntime元素需要如下所示:

<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />

此外,似乎.NET 4.5不支持supportedFramework元素,需要删除它们.

点赞