I’m trying to upgrade my project from wix v3 to wix v4.
The wix project are as follow :
- A wix setup
- A wix bundle
- A wpf .net 6 class library managed bootstaper
I followed this example https://github.com/wixtoolset/Bal.wixext/tree/master/src/test/examples/WPFCoreMBA and this doc https://wixtoolset.org/docs/development/wips/modify-burn-api/
When I publish the boostraper project, build the bundle and launched it I get this log and errors. How can I fix that ?
[0DA8:0DB4][2023-01-02T18:23:27]e000: Error 0x80131522: Failed to create delegate
through GetFunctionPointer.
[0DA8:0DB4][2023-01-02T18:23:27]e000: Error 0x80131522: Failed to create the .NET Core
bootstrapper application factory.
[0DA8:0DB4][2023-01-02T18:23:27]e000: Error 0x80131522: Failed to create BA.
[0DA8:0DB4][2023-01-02T18:23:27]e000: Error 0x80131522: Failed to load BA.
[0DA8:0DB4][2023-01-02T18:23:27]e000: Error 0x80131522: Failed while running
The bundle.wxs
<BootstrapperApplication>
<Payload SourceFile="..\LanguageSelector\bin\Release\net6.0-windows\publish\win-x86\LanguageSelector.dll" Name="LanguageSelector.dll" bal:BAFactoryAssembly="yes" />
<Payload SourceFile="..\LanguageSelector\bin\Release\net6.0-windows\publish\win-x86\LanguageSelector.deps.json" Name="LanguageSelector.deps.json"/>
<Payload SourceFile="..\LanguageSelector\bin\Release\net6.0-windows\publish\win-x86\LanguageSelector.runtimeconfig.json" Name="LanguageSelector.runtimeconfig.json" />
<Payload SourceFile="..\LanguageSelector\bin\Release\net6.0-windows\publish\win-x86\WixToolset.Mba.Core.dll" Name="WixToolset.Mba.Core.dll" />
<Payload SourceFile="..\LanguageSelector\bin\Release\net6.0-windows\publish\win-x86\mbanative.dll" Name="mbanative.dll" />
<Payload SourceFile="..\LanguageSelector\bin\Release\net6.0-windows\publish\win-x86\GalaSoft.MvvmLight.dll" Name="GalaSoft.MvvmLight.dll" />
<bal:WixDotNetCoreBootstrapperApplicationHost />
The LanguageSelectorFactory0cs
[assembly: WixToolset.Mba.Core.BootstrapperApplicationFactory(typeof(LanguageSelector.LanguageSelectorFactory))]
namespace LanguageSelector
{
using WixToolset.Mba.Core;
public class LanguageSelectorFactory : BaseBootstrapperApplicationFactory
{
private static int loadCount = 0;
protected override IBootstrapperApplication Create(IEngine engine,
IBootstrapperCommand bootstrapperCommand)
{
if (loadCount > 0)
{
engine.Log(LogLevel.Standard, $"Reloaded {loadCount} time(s)");
}
++loadCount;
return new LanguageSelector(engine, bootstrapperCommand);
}
}
}