[Bug] Can't run published WinUI app.
See original GitHub issueHow to reproduce:
Create a new MAUI project (VS 16.11.0 preview 2)
Debug => Runs fine Publish => Running the published app Starts then exits with following error (from event viewer)
Application: MauiApp2.WinUI.exe CoreCLR Version: 6.0.21.30105 .NET Version: 6.0.0-preview.5.21301.5 Description: The process was terminated due to an unhandled exception. Exception Info: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> System.Runtime.InteropServices.COMException (0x80040154): Class not registered (0x80040154 (REGDB_E_CLASSNOTREG)) at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode) in System.Private.CoreLib.dll:token 0x600467f+0x4 at WinRT.BaseActivationFactory…ctor(String typeNamespace, String typeFullName) in Microsoft.WinUI.dll:token 0x6000023+0x6e at Microsoft.UI.Xaml.Application._IApplicationStatics…ctor() in Microsoft.WinUI.dll:token 0x6014cbd+0x1c at System.RuntimeType.CreateInstanceOfT() in System.Private.CoreLib.dll:token 0x6000645+0x3e — End of inner exception stack trace — at System.RuntimeType.CreateInstanceOfT() in System.Private.CoreLib.dll:token 0x6000645+0x4e at System.Activator.CreateInstanceT in System.Private.CoreLib.dll:token 0x6000963+0x0 at WinRT.WeakLazy`1.get_Value() in Microsoft.WinUI.dll:token 0x6000019+0x20 at Microsoft.UI.Xaml.Application.Start(ApplicationInitializationCallback callback) in Microsoft.WinUI.dll:token 0x6009b84+0x0 at MauiApp2.WinUI.Program.Main(String[] args) in C:\Users\mark\source\repos\MauiApp2\MauiApp2\MauiApp2.WinUI\obj\Release\net6.0-windows10.0.19041\win10-x64\Windows\App.g.i.cs:line 26
Issue Analytics
- State:
- Created 2 years ago
- Reactions:6
- Comments:15 (2 by maintainers)
Same Problem here. I can run the project in Visual Studio 2019 Preview without any problems. But as soon as i build the executable and launch it, i get the same crash report in the windows event viewer.
.NET SDK Version: 6.0.100-preview.5.21302.13 Commit: d6380bcae7
Runtime: OS Name: Windows OS Version: 10.0.19042 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\6.0.100-preview.5.21302.13\
Host (useful for support): Version: 6.0.0-preview.5.21301.5 Commit: ec3e0b276b
.NET SDKs installed: 2.2.203 [C:\Program Files\dotnet\sdk] 3.1.410 [C:\Program Files\dotnet\sdk] 5.0.400-preview.21277.10 [C:\Program Files\dotnet\sdk] 6.0.100-preview.5.21302.13 [C:\Program Files\dotnet\sdk]
.NET runtimes installed: Microsoft.AspNetCore.All 2.2.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.2.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.0-preview.5.21301.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.2.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.0-preview.5.21301.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.16 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.0-preview.5.21301.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
环境 Microsoft Visual Studio Enterprise 2022 (64 位) - Preview 版本 17.1.0 Preview 1.1 MAUI Perview11
调试 Blazor MAUI 在 VS2022 中运行正常。
发布单文件时,我遇到了问题,怎么解决?
————————————————————————————————————————————— FolderProfile.pubxml
————————————————————————————————————————————— 输出
————————————————————————————————————————————— 弹窗
————————————————————————————————————————————— tmp36FD.tmp
—————————————————————————————————————————————