У меня более сложное приложение Maui, которое выдает InteropServices.COMException > ошибка. Для устранения неполадок создал стандартный/пустой проект .Net Maui, а затем попытался собрать его как автономное приложение.
Шаги по воспроизведению
- Создать новый проект
Приложение .NET MAUI - .NET 8.0 Framework
- Оно работает нормально. Я вижу приложение.
- $ рабочая нагрузка dotnet install maui maui-windows
- $ обновление рабочей нагрузки dotnet
- $ dotnetPublish ./myProject.csproj -c Release -r win-x64 - ж net8.0-windows10.0.19041.0 --self-contained=true --output "$TARGET_DIR/" ;
- Приложение не открывается
- Исключение InteropServices.COM
файл csproj
net8.0-android;net8.0-ios;net8.0-maccatalyst
$(TargetFrameworks);net8.0;net8.0-windows10.0.19041.0
Exe
myApp
true
true
enable
enable
true
myApp
com.me.myApp
1.0
1
11.0
13.1
21.0
10.0.17763.0
10.0.17763.0
6.5
Direct
Always
embedded
embedded
embedded
embedded
embedded
embedded
embedded
embedded
embedded
embedded
Ошибка просмотра событий
-
-
1026
0
2
0
0
0x80000000000000
13421
Application
myComputer
-
Application: MyApp.exe CoreCLR Version: 8.0.1124.51707 .NET Version: 8.0.11 Description: The process was terminated due to an unhandled exception. Exception Info: System.TypeInitializationException: The type initializer for '' threw an exception. ---> System.TypeInitializationException: The type initializer for 'WinRT.ActivationFactory`1' threw an exception. ---> System.Runtime.InteropServices.COMException (0x80040154): Class not registered (0x80040154 (REGDB_E_CLASSNOTREG)) at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode) at WinRT.BaseActivationFactory..ctor(String typeNamespace, String typeFullName) at WinRT.ActivationFactory`1..cctor() --- End of inner exception stack trace --- at WinRT.ActivationFactory`1.ActivateInstance() at Microsoft.Windows.ApplicationModel.WindowsAppRuntime.DeploymentInitializeOptions..ctor() at Microsoft.Windows.ApplicationModel.WindowsAppRuntime.DeploymentManagerCS.AutoInitialize.AccessWindowsAppSDK() in C:\Users\myUser\.nuget\packages\microsoft.windowsappsdk\1.5.240627000\include\DeploymentManagerAutoInitializer.cs:line 30 at .cctor() --- End of inner exception stack trace ---
Подробнее здесь: https://stackoverflow.com/questions/793 ... efault-app
Мобильная версия