0

I'm converting a WIX3/.NET4.8 installer to WIX4/.NET6. At the moment, I'm trying to see from the bundle our custom BA, which was converted to .NET6.

See previous question with more background

With the BA set to win-x64 (for both build and publishing self-contained) and to a dll output, I get the errors bellow.

[1E3C:08BC][2023-02-08T10:23:02]e000: error from hostfxr: You must install or update .NET to run this application.

App: C:\Windows\TEMP\{8521A191-8C06-4ED8-880A-4FE878955375}\.cr\visionCATS.exe
Architecture: x64
[1E3C:08BC][2023-02-08T10:23:02]e000: error from hostfxr: Framework: 'Microsoft.NETCore.App', version '6.0.0' (x64)
[1E3C:08BC][2023-02-08T10:23:02]e000: error from hostfxr: .NET location: C:\Windows\TEMP\{414A222D-3B83-4894-8FC0-5AD87CF921E3}\.ba\

[1E3C:08BC][2023-02-08T10:23:02]e000: error from hostfxr: No frameworks were found.
[1E3C:08BC][2023-02-08T10:23:02]e000: error from hostfxr: 
Learn about framework resolution:
https://aka.ms/dotnet/app-launch-failed

To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=6.0.0&arch=x64&rid=win10-x64
[1E3C:08BC][2023-02-08T10:23:02]e000: Error 0x80008096: HostfxrInitializeForApp failed
[1E3C:08BC][2023-02-08T10:23:02]e000: Error 0x80008096: Failed to initialize hostfxr.
[1E3C:08BC][2023-02-08T10:23:02]e000: Error 0x80008096: The self-contained .NET Core runtime failed to load. This is an unrecoverable error.
[1E3C:08BC][2023-02-08T10:23:02]i000: Loading prerequisite bootstrapper application because .NET Core host could not be loaded, error: 0x80008096.

My test application emulating WIX can also use the BA dll in x64, and the UI is displayed without issue on a VM without .NET6 runtime. It is only from the bundle itself that it isn't working.

PBY
  • 3
  • 3
  • Are you sure that you have included all the files that were published for your BA? I've never seen this before when publishing as self-contained. – Sean Hall Feb 09 '23 at 16:01
  • Yes, if I copy the files from publish folder on a fresh VM, it is starting fine when the test exe launch it (no other dll copied than the BA). Same when the BA was an exe. And the output of heat seems correct. Is it an example somewhere of a .net 6 self contained BA and its bundle? I only saw framework deploy BA used in some unit tests, and no real bundle. – PBY Feb 10 '23 at 06:56
  • If you want to test it properly with a test harness, you should run `wix burn extract path\to\bundle.exe -out path\to\extractfolder` to get the actual files contained in the bundle instead of copying it from the publish folder. There are some tests in the Bal extension that have a test harness that loads a self contained BA. – Sean Hall Feb 10 '23 at 15:22
  • Did you ever find out what was wrong? – Sean Hall Mar 13 '23 at 02:39
  • Unfortunately not, I switched to having a .NET 4.8 UI without link to the .NET 6 code used in custom actions and the application. Works fine with WIX 3, but I have a similar issue when upgrading to WIX 4: the BA failed to load, but without more details in the error messages – PBY Mar 13 '23 at 07:38
  • At this point you'll have to create a repo on Github or somehow provide a full working example in order to get help. There are too many variables in setting up a managed bootstrapper application to be able to guess what's wrong. – Sean Hall Mar 13 '23 at 17:44
  • I will see when I can invest time on it, as we have now a working installer for our .NET 6 application, with WIX 3 – PBY Mar 14 '23 at 09:23

0 Answers0