microsoft / microsoft-ui-xaml

Windows UI Library: the latest Windows 10 native controls and Fluent styles for your applications
MIT License
6.28k stars 674 forks source link

[.NET MAUI 9.0 Preview 6, SkiaSharp 3.0-preview4.1] On Windows/WinUI 3 SkiaSharp's SKGLView crashes a .NET MAUI app when it is built in the unpackaged mode #9873

Open TommiGustafsson-HMP opened 1 month ago

TommiGustafsson-HMP commented 1 month ago

Describe the bug

Technology stack

Bug

SKGLView crashes the app at runtime when .NET MAUI App is built in the unpackaged mode (-p:WindowsPackageType=None).

Steps to reproduce the bug

  1. Clone the public reproduction repository (link) and open the solution in Visual Studio 2022 Preview (latest).
  2. First, let's check that things work in the packaged mode.
  3. Select Windows Machine and click the green Debug button.
  4. The app should start.
  5. Click the Click Me button. A new page with some text should open. The app will not crash.
  6. Close the app and go back to Visual Studio 2022 Preview.
  7. Open the Developer PowerShell and check that you are in the solution folder.
  8. Delete bin and obj folders. (Otherwise the unpackaged app will not start.)
  9. Build the unpackaged app with dotnet build -f:net9.0-windows10.0.19041.0 -c:Debug -p:WindowsPackageType=None -p:RuntimeIdentifierOverride=win10-x64 -p:WindowsAppSDKSelfContained=true
  10. Open File Explorer and go to bin\Debug\net9.0-windows10.0.19041.0\win10-x64. The unpackaged app should be there.
  11. Click on WindowsMauiUnpackagedSKGLViewError.exe.
  12. The app will start.
  13. Click on the Click me button.
  14. The app will crash.
  15. Now, open Event Viewer and see the Windows Logs → Application error messages.

Expected behavior

App would not crash.

Screenshots

No response

NuGet package version

None

Windows version

No response

Additional context

Relevant log output

Log Name:      Application
Source:        .NET Runtime
Date:          20.7.2024 21.57.32
Event ID:      1026
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Description:
Application: WindowsMauiUnpackagedSKGLViewError.exe
CoreCLR Version: 9.0.24.32707
.NET Version: 9.0.0-preview.6.24327.7
Description: The process was terminated due to an unhandled exception.
Stack:
   at SkiaSharp.Views.GlesInterop.Egl.eglGetPlatformDisplayEXT(UInt32, IntPtr, Int32[])
   at SkiaSharp.Views.GlesInterop.Egl.eglGetPlatformDisplayEXT(UInt32, IntPtr, Int32[])
   at SkiaSharp.Views.GlesInterop.GlesContext.InitializeDisplay()
   at SkiaSharp.Views.GlesInterop.GlesContext..ctor()
   at SkiaSharp.Views.Windows.AngleSwapChainPanel.OnLoaded(System.Object, Microsoft.UI.Xaml.RoutedEventArgs)
   at WinRT._EventSource_global__Microsoft_UI_Xaml_RoutedEventHandler+EventState.<GetEventInvoke>b__1_0(System.Object, Microsoft.UI.Xaml.RoutedEventArgs)
   at ABI.Microsoft.UI.Xaml.RoutedEventHandler.Do_Abi_Invoke(IntPtr, IntPtr, IntPtr)
   at ABI.Microsoft.UI.Xaml.IApplicationStaticsMethods.Start(WinRT.IObjectReference, Microsoft.UI.Xaml.ApplicationInitializationCallback)
   at Microsoft.UI.Xaml.Application.Start(Microsoft.UI.Xaml.ApplicationInitializationCallback)
   at WindowsMauiUnpackagedSKGLViewError.WinUI.Program.Main(System.String[])

Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name=".NET Runtime" />
    <EventID Qualifiers="0">1026</EventID>
    <Version>0</Version>
    <Level>2</Level>
    <Task>0</Task>
    <Opcode>0</Opcode>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2024-07-20T18:57:32.8237381Z" />
    <EventRecordID>82274</EventRecordID>
    <Correlation />
    <Execution ProcessID="2176" ThreadID="0" />
    <Channel>Application</Channel>
  </System>
  <EventData>
    <Data>Application: WindowsMauiUnpackagedSKGLViewError.exe
CoreCLR Version: 9.0.24.32707
.NET Version: 9.0.0-preview.6.24327.7
Description: The process was terminated due to an unhandled exception.
Stack:
   at SkiaSharp.Views.GlesInterop.Egl.eglGetPlatformDisplayEXT(UInt32, IntPtr, Int32[])
   at SkiaSharp.Views.GlesInterop.Egl.eglGetPlatformDisplayEXT(UInt32, IntPtr, Int32[])
   at SkiaSharp.Views.GlesInterop.GlesContext.InitializeDisplay()
   at SkiaSharp.Views.GlesInterop.GlesContext..ctor()
   at SkiaSharp.Views.Windows.AngleSwapChainPanel.OnLoaded(System.Object, Microsoft.UI.Xaml.RoutedEventArgs)
   at WinRT._EventSource_global__Microsoft_UI_Xaml_RoutedEventHandler+EventState.&lt;GetEventInvoke&gt;b__1_0(System.Object, Microsoft.UI.Xaml.RoutedEventArgs)
   at ABI.Microsoft.UI.Xaml.RoutedEventHandler.Do_Abi_Invoke(IntPtr, IntPtr, IntPtr)
   at ABI.Microsoft.UI.Xaml.IApplicationStaticsMethods.Start(WinRT.IObjectReference, Microsoft.UI.Xaml.ApplicationInitializationCallback)
   at Microsoft.UI.Xaml.Application.Start(Microsoft.UI.Xaml.ApplicationInitializationCallback)
   at WindowsMauiUnpackagedSKGLViewError.WinUI.Program.Main(System.String[])
</Data>
  </EventData>
</Event>

Log Name:      Application
Source:        Application Error
Date:          20.7.2024 21.57.33
Event ID:      1000
Task Category: Application Crashing Events
Level:         Error
Keywords:      
Description:
Faulting application name: WindowsMauiUnpackagedSKGLViewError.exe, version: 1.0.0.0, time stamp: 0x667d0000
Faulting module name: coreclr.dll, version: 9.0.24.32707, time stamp: 0x667de227
Exception code: 0xc0000005
Fault offset: 0x00000000002de54e
Faulting process ID: 0x0x880
Faulting application start time: 0x0x1DADAD6AC829340
Faulting application path: C:\hmp\WindowsMauiUnpackagedSKGLViewError\WindowsMauiUnpackagedSKGLViewError\WindowsMauiUnpackagedSKGLViewError\bin\Debug\net9.0-windows10.0.19041.0\win10-x64\WindowsMauiUnpackagedSKGLViewError.exe
Faulting module path: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0-preview.6.24327.7\coreclr.dll
Report ID: 3e1585be-c9dd-41c0-aa20-9933b81efeae
Faulting package full name: 
Faulting package-relative application ID: 
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Application Error" Guid="{a0e9b465-b939-57d7-b27d-95d8e925ff57}" />
    <EventID>1000</EventID>
    <Version>0</Version>
    <Level>2</Level>
    <Task>100</Task>
    <Opcode>0</Opcode>
    <Keywords>0x8000000000000000</Keywords>
    <TimeCreated SystemTime="2024-07-20T18:57:33.1772821Z" />
    <EventRecordID>82275</EventRecordID>
    <Correlation />
    <Execution ProcessID="52744" ThreadID="31284" />
    <Channel>Application</Channel>
  </System>
  <EventData>
    <Data Name="AppName">WindowsMauiUnpackagedSKGLViewError.exe</Data>
    <Data Name="AppVersion">1.0.0.0</Data>
    <Data Name="AppTimeStamp">667d0000</Data>
    <Data Name="ModuleName">coreclr.dll</Data>
    <Data Name="ModuleVersion">9.0.24.32707</Data>
    <Data Name="ModuleTimeStamp">667de227</Data>
    <Data Name="ExceptionCode">c0000005</Data>
    <Data Name="FaultingOffset">00000000002de54e</Data>
    <Data Name="ProcessId">0x880</Data>
    <Data Name="ProcessCreationTime">0x1dadad6ac829340</Data>
    <Data Name="AppPath">C:\hmp\WindowsMauiUnpackagedSKGLViewError\WindowsMauiUnpackagedSKGLViewError\WindowsMauiUnpackagedSKGLViewError\bin\Debug\net9.0-windows10.0.19041.0\win10-x64\WindowsMauiUnpackagedSKGLViewError.exe</Data>
    <Data Name="ModulePath">C:\Program Files\dotnet\shared\Microsoft.NETCore.App\9.0.0-preview.6.24327.7\coreclr.dll</Data>
    <Data Name="IntegratorReportId">3e1585be-c9dd-41c0-aa20-9933b81efeae</Data>
    <Data Name="PackageFullName">
    </Data>
    <Data Name="PackageRelativeAppId">
    </Data>
  </EventData>
</Event>
DarranRowe commented 1 month ago

I know these three questions are obvious, however, I have found no reference to this in the report.

  1. Did you verify that no extra package dependencies were added to the AppxManifest.xml file? The build process takes the project's Package.appxmanifest file and fills in any extra details. Visual Studio checks any NuGet references and add dependencies as needed.
  2. Did you verify that the directory layout for the unpackaged application was the same as the packaged application? This could be relying on libraries being in the correct location, but the build process only moves things into the correct location as part of the packaging process.
  3. Did you check for any extra activation information being added to the package? In these cases, did you check if they were activatable in an unpackaged application? An example of this is actually the C++ projection. C++/WinRT tries very hard to activate a type, even to the point of falling back to looking for namespace named libraries in the application directory and querying them directly. To give an example from Win2D, this registers itself in the AppxManifest.xml file: Screenshot 2024-08-05 124233

    //Two methods to attempt to obtain the activation factory for Microsoft.Graphics.Canvas.Effects.BlendEffect
    winrt::Windows::Foundation::IAsyncAction MainWindow::Click_Click(winrt::IInspectable const &, winrt::RoutedEventArgs const &)
    {
    //The runtime class to obtain the activation factory for.
    constexpr const wchar_t runtime_class_string[] = L"Microsoft.Graphics.Canvas.Effects.BlendEffect";
    //Attempt to obtain this via the ABI.
    //This FAILS in an unpackaged desktop application.
    HSTRING rs{};
    HRESULT hr = WindowsCreateString(runtime_class_string, ARRAYSIZE(runtime_class_string)-1, &rs);
    com_ptr<::IActivationFactory> af;
    hr = RoGetActivationFactory(rs, IID_PPV_ARGS(af.put()));
    WindowsDeleteString(rs);
    rs = nullptr;
    //Attempt to obtain this via C++/WinRT
    //This SUCCEEDS in an unpackaged desktop application.
    auto af_wrt = winrt::get_activation_factory(runtime_class_string);
    
    co_return;
    }

    This is using C++, but using the ABI is easier here. The big point is, are you sure that the WinRT objects that are not part of the Windows App Runtime activate properly. If they are registered in the package and they don't, you may need to add the registrations to the application manifest file using registration free WinRT.

I know these are pretty generic questions and observations. But these should be general things to check.

TommiGustafsson-HMP commented 1 month ago
  1. Did you verify that no extra package dependencies were added to the AppxManifest.xml file? The build process takes the project's Package.appxmanifest file and fills in any extra details. Visual Studio checks any NuGet references and add dependencies as needed.

The unpackaged version doesn't have AppxManifest.xml file.

  1. Did you verify that the directory layout for the unpackaged application was the same as the packaged application? This could be relying on libraries being in the correct location, but the build process only moves things into the correct location as part of the packaging process.

No, they are quite different.

Packaged App

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----          5.8.2024     15.55                ar
d-----          5.8.2024     15.55                ca
d-----          5.8.2024     15.55                cs
d-----          5.8.2024     15.55                da
d-----          5.8.2024     15.55                de
d-----          5.8.2024     15.55                el
d-----          5.8.2024     15.55                es
d-----          5.8.2024     15.55                fi
d-----          5.8.2024     15.55                fr
d-----          5.8.2024     15.55                he
d-----          5.8.2024     15.55                hi
d-----          5.8.2024     15.55                hr
d-----          5.8.2024     15.55                hu
d-----          5.8.2024     15.55                id
d-----          5.8.2024     15.55                it
d-----          5.8.2024     15.55                ja
d-----          5.8.2024     15.55                ko
d-----          5.8.2024     15.55                ms
d-----          5.8.2024     15.55                nb
d-----          5.8.2024     15.55                nl
d-----          5.8.2024     15.55                pl
d-----          5.8.2024     15.55                Platforms
d-----          5.8.2024     15.55                pt
d-----          5.8.2024     15.55                pt-BR
d-----          5.8.2024     15.54                publish
d-----          5.8.2024     15.55                ro
d-----          5.8.2024     15.55                ru
d-----          5.8.2024     15.55                sk
d-----          5.8.2024     15.55                sv
d-----          5.8.2024     15.55                th
d-----          5.8.2024     15.55                tr
d-----          5.8.2024     15.55                uk
d-----          5.8.2024     15.55                vi
d-----          5.8.2024     15.55                zh-Hans
d-----          5.8.2024     15.55                zh-Hant
d-----          5.8.2024     15.55                zh-HK
-a----          5.8.2024     15.54           2956 AppxManifest.xml
-a----         18.7.2024      1.33         191408 libEGL.dll
-a----         18.7.2024      1.33        5123112 libGLESv2.dll
-a----         18.7.2024      1.32        9605040 libSkiaSharp.dll
-a----         28.6.2024      1.06          29448 Microsoft.Extensions.Configuration.Abstractions.dll
-a----         28.6.2024      1.06          45328 Microsoft.Extensions.Configuration.dll
-a----         28.6.2024      1.06          66320 Microsoft.Extensions.DependencyInjection.Abstractions.dll
-a----         28.6.2024      1.06          93472 Microsoft.Extensions.DependencyInjection.dll
-a----         28.6.2024      1.06          67232 Microsoft.Extensions.Logging.Abstractions.dll
-a----         28.6.2024      1.06          20144 Microsoft.Extensions.Logging.Debug.dll
-a----         28.6.2024      1.06          52488 Microsoft.Extensions.Logging.dll
-a----         28.6.2024      1.06          66208 Microsoft.Extensions.Options.dll
-a----         28.6.2024      1.05          45344 Microsoft.Extensions.Primitives.dll
-a----         11.3.2024     17.36        1658416 Microsoft.Graphics.Canvas.dll
-a----         11.3.2024     17.36        1111080 Microsoft.Graphics.Canvas.Interop.dll
-a----          7.6.2024      3.23        1325088 Microsoft.InteractiveExperiences.Projection.dll
-a----         27.6.2024     22.59        1699872 Microsoft.Maui.Controls.dll
-a----         27.6.2024     23.00         133152 Microsoft.Maui.Controls.Xaml.dll
-a----         27.6.2024     23.00         675264 Microsoft.Maui.dll
-a----         27.6.2024     23.02         241184 Microsoft.Maui.Essentials.dll
-a----         27.6.2024     23.02         212400 Microsoft.Maui.Graphics.dll
-a----         27.6.2024     23.02          57264 Microsoft.Maui.Graphics.Win2D.WinUI.Desktop.dll
-a----          7.6.2024     20.05          54192 Microsoft.Windows.ApplicationModel.DynamicDependency.Projection.dll
-a----          7.6.2024      9.06          69568 Microsoft.Windows.ApplicationModel.Resources.Projection.dll
-a----          7.6.2024     20.05          43952 Microsoft.Windows.ApplicationModel.WindowsAppRuntime.Projection.dll
-a----          7.6.2024     20.05          47664 Microsoft.Windows.AppLifecycle.Projection.dll
-a----          7.6.2024     20.05          73136 Microsoft.Windows.AppNotifications.Builder.Projection.dll
-a----          7.6.2024     20.05          60848 Microsoft.Windows.AppNotifications.Projection.dll
-a----          7.6.2024     20.05         109600 Microsoft.Windows.Management.Deployment.Projection.dll
-a----          7.6.2024     20.05          51760 Microsoft.Windows.PushNotifications.Projection.dll
-a----        16.10.2023     22.41       21678632 Microsoft.Windows.SDK.NET.dll
-a----          7.6.2024     20.05          34352 Microsoft.Windows.Security.AccessControl.Projection.dll
-a----          7.6.2024     20.05          44976 Microsoft.Windows.System.Power.Projection.dll
-a----          7.6.2024     20.05          37808 Microsoft.Windows.System.Projection.dll
-a----         29.3.2024      1.55         144416 Microsoft.Windows.Widgets.Projection.dll
-a----          7.6.2024      9.05         391200 Microsoft.WindowsAppRuntime.Bootstrap.dll
-a----          7.6.2024     20.05          16816 Microsoft.WindowsAppRuntime.Bootstrap.Net.dll
-a----          7.6.2024     20.05        7207856 Microsoft.WinUI.dll
-a----          5.8.2024     15.54          37160 resources.pri
-a----         18.7.2024      1.31         415776 SkiaSharp.dll
-a----         18.7.2024      1.31          25632 SkiaSharp.Views.Maui.Controls.dll
-a----         18.7.2024      1.30          35360 SkiaSharp.Views.Maui.Core.dll
-a----         18.7.2024      1.31          45600 SkiaSharp.Views.Windows.dll
-a----         18.7.2024      1.31          53296 SkiaSharp.Views.WinUI.Native.dll
-a----         18.7.2024      1.31          35360 SkiaSharp.Views.WinUI.Native.Projection.dll
-a----         18.7.2024      0.13           2048 SkiaSharp.Views.WinUI.Native.winmd
-a----          5.8.2024     15.54          49526 WindowsMauiUnpackagedSKGLViewError.build.appxrecipe
-a----          5.8.2024     15.54          31959 WindowsMauiUnpackagedSKGLViewError.deps.json
-a----          5.8.2024     15.54          91136 WindowsMauiUnpackagedSKGLViewError.dll
-a----          5.8.2024     15.54         140800 WindowsMauiUnpackagedSKGLViewError.exe
-a----          5.8.2024     15.54          49128 WindowsMauiUnpackagedSKGLViewError.pdb
-a----          5.8.2024     15.54            524 WindowsMauiUnpackagedSKGLViewError.runtimeconfig.json
-a----        16.10.2023     22.41         399280 WinRT.Runtime.dll

Unpackaged

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----          5.8.2024     16.00                af-ZA
d-----          5.8.2024     16.00                am-ET
d-----          5.8.2024     16.00                ar
d-----          5.8.2024     16.00                ar-SA
d-----          5.8.2024     16.00                as-IN
d-----          5.8.2024     16.00                az-Latn-AZ
d-----          5.8.2024     16.00                bg-BG
d-----          5.8.2024     16.00                bn-IN
d-----          5.8.2024     16.00                bs-Latn-BA
d-----          5.8.2024     16.00                ca
d-----          5.8.2024     16.00                ca-ES
d-----          5.8.2024     16.00                ca-Es-VALENCIA
d-----          5.8.2024     16.00                cs
d-----          5.8.2024     16.00                cs-CZ
d-----          5.8.2024     16.00                cy-GB
d-----          5.8.2024     16.00                da
d-----          5.8.2024     16.00                da-DK
d-----          5.8.2024     16.00                de
d-----          5.8.2024     16.00                de-DE
d-----          5.8.2024     16.00                el
d-----          5.8.2024     16.00                el-GR
d-----          5.8.2024     16.00                en-GB
d-----          5.8.2024     16.00                en-us
d-----          5.8.2024     16.00                es
d-----          5.8.2024     16.00                es-ES
d-----          5.8.2024     16.00                es-MX
d-----          5.8.2024     16.00                et-EE
d-----          5.8.2024     16.00                eu-ES
d-----          5.8.2024     16.00                fa-IR
d-----          5.8.2024     16.00                fi
d-----          5.8.2024     16.00                fi-FI
d-----          5.8.2024     16.00                fil-PH
d-----          5.8.2024     16.00                fr
d-----          5.8.2024     16.00                fr-CA
d-----          5.8.2024     16.00                fr-FR
d-----          5.8.2024     16.00                ga-IE
d-----          5.8.2024     16.00                gd-gb
d-----          5.8.2024     16.00                gl-ES
d-----          5.8.2024     16.00                gu-IN
d-----          5.8.2024     16.00                he
d-----          5.8.2024     16.00                he-IL
d-----          5.8.2024     16.00                hi
d-----          5.8.2024     16.00                hi-IN
d-----          5.8.2024     16.00                hr
d-----          5.8.2024     16.00                hr-HR
d-----          5.8.2024     16.00                hu
d-----          5.8.2024     16.00                hu-HU
d-----          5.8.2024     16.00                hy-AM
d-----          5.8.2024     16.00                id
d-----          5.8.2024     16.00                id-ID
d-----          5.8.2024     16.00                is-IS
d-----          5.8.2024     16.00                it
d-----          5.8.2024     16.00                it-IT
d-----          5.8.2024     16.00                ja
d-----          5.8.2024     16.00                ja-JP
d-----          5.8.2024     16.00                ka-GE
d-----          5.8.2024     16.00                kk-KZ
d-----          5.8.2024     16.00                km-KH
d-----          5.8.2024     16.00                kn-IN
d-----          5.8.2024     16.00                ko
d-----          5.8.2024     16.00                ko-KR
d-----          5.8.2024     16.00                kok-IN
d-----          5.8.2024     16.00                lb-LU
d-----          5.8.2024     16.00                lo-LA
d-----          5.8.2024     16.00                lt-LT
d-----          5.8.2024     16.00                lv-LV
d-----          5.8.2024     16.00                mi-NZ
d-----          5.8.2024     16.00                Microsoft.UI.Xaml
d-----          5.8.2024     16.00                mk-MK
d-----          5.8.2024     16.00                ml-IN
d-----          5.8.2024     16.00                mr-IN
d-----          5.8.2024     16.00                ms
d-----          5.8.2024     16.00                ms-MY
d-----          5.8.2024     16.00                mt-MT
d-----          5.8.2024     16.00                nb
d-----          5.8.2024     16.00                nb-NO
d-----          5.8.2024     16.00                ne-NP
d-----          5.8.2024     16.00                nl
d-----          5.8.2024     16.00                nl-NL
d-----          5.8.2024     16.00                nn-NO
d-----          5.8.2024     16.00                or-IN
d-----          5.8.2024     16.00                pa-IN
d-----          5.8.2024     16.00                pl
d-----          5.8.2024     16.00                pl-PL
d-----          5.8.2024     16.00                Platforms
d-----          5.8.2024     16.00                pt
d-----          5.8.2024     16.00                pt-BR
d-----          5.8.2024     16.00                pt-PT
d-----          5.8.2024     16.00                quz-PE
d-----          5.8.2024     16.00                ro
d-----          5.8.2024     16.00                ro-RO
d-----          5.8.2024     16.00                ru
d-----          5.8.2024     16.00                ru-RU
d-----          5.8.2024     16.00                sk
d-----          5.8.2024     16.00                sk-SK
d-----          5.8.2024     16.00                sl-SI
d-----          5.8.2024     16.00                sq-AL
d-----          5.8.2024     16.00                sr-Cyrl-BA
d-----          5.8.2024     16.00                sr-Cyrl-RS
d-----          5.8.2024     16.00                sr-Latn-RS
d-----          5.8.2024     16.00                sv
d-----          5.8.2024     16.00                sv-SE
d-----          5.8.2024     16.00                ta-IN
d-----          5.8.2024     16.00                te-IN
d-----          5.8.2024     16.00                th
d-----          5.8.2024     16.00                th-TH
d-----          5.8.2024     16.00                tr
d-----          5.8.2024     16.00                tr-TR
d-----          5.8.2024     16.00                tt-RU
d-----          5.8.2024     16.00                ug-CN
d-----          5.8.2024     16.00                uk
d-----          5.8.2024     16.00                uk-UA
d-----          5.8.2024     16.00                ur-PK
d-----          5.8.2024     16.00                uz-Latn-UZ
d-----          5.8.2024     16.00                vi
d-----          5.8.2024     16.00                vi-VN
d-----          5.8.2024     16.00                zh-CN
d-----          5.8.2024     16.00                zh-Hans
d-----          5.8.2024     16.00                zh-Hant
d-----          5.8.2024     16.00                zh-HK
d-----          5.8.2024     16.00                zh-TW
-a----         20.7.2024     21.15            657 AboutAssets.txt
-a----          5.8.2024     15.59            974 appicon.ico
-a----          5.8.2024     15.59           3959 appiconLargeTile.scale-100.png
-a----          5.8.2024     15.59           5216 appiconLargeTile.scale-125.png
-a----          5.8.2024     15.59           4769 appiconLargeTile.scale-150.png
-a----          5.8.2024     15.59           6711 appiconLargeTile.scale-200.png
-a----          5.8.2024     15.59          16539 appiconLargeTile.scale-400.png
-a----          5.8.2024     15.59            320 appiconLogo.altform-lightunplated_targetsize-16.png
-a----          5.8.2024     15.59            519 appiconLogo.altform-lightunplated_targetsize-24.png
-a----          5.8.2024     15.59           2725 appiconLogo.altform-lightunplated_targetsize-256.png
-a----          5.8.2024     15.59            497 appiconLogo.altform-lightunplated_targetsize-32.png
-a----          5.8.2024     15.59            868 appiconLogo.altform-lightunplated_targetsize-48.png
-a----          5.8.2024     15.59            320 appiconLogo.altform-unplated_targetsize-16.png
-a----          5.8.2024     15.59            519 appiconLogo.altform-unplated_targetsize-24.png
-a----          5.8.2024     15.59           2725 appiconLogo.altform-unplated_targetsize-256.png
-a----          5.8.2024     15.59            497 appiconLogo.altform-unplated_targetsize-32.png
-a----          5.8.2024     15.59            868 appiconLogo.altform-unplated_targetsize-48.png
-a----          5.8.2024     15.59            748 appiconLogo.scale-100.png
-a----          5.8.2024     15.59            999 appiconLogo.scale-125.png
-a----          5.8.2024     15.59            986 appiconLogo.scale-150.png
-a----          5.8.2024     15.59           1365 appiconLogo.scale-200.png
-a----          5.8.2024     15.59           2436 appiconLogo.scale-400.png
-a----          5.8.2024     15.59            320 appiconLogo.targetsize-16.png
-a----          5.8.2024     15.59            519 appiconLogo.targetsize-24.png
-a----          5.8.2024     15.59           2725 appiconLogo.targetsize-256.png
-a----          5.8.2024     15.59            497 appiconLogo.targetsize-32.png
-a----          5.8.2024     15.59            868 appiconLogo.targetsize-48.png
-a----          5.8.2024     15.59           1831 appiconMediumTile.scale-100.png
-a----          5.8.2024     15.59           2622 appiconMediumTile.scale-125.png
-a----          5.8.2024     15.59           3406 appiconMediumTile.scale-150.png
-a----          5.8.2024     15.59           3540 appiconMediumTile.scale-200.png
-a----          5.8.2024     15.59           6431 appiconMediumTile.scale-400.png
-a----          5.8.2024     15.59           1089 appiconSmallTile.scale-100.png
-a----          5.8.2024     15.59           1411 appiconSmallTile.scale-125.png
-a----          5.8.2024     15.59           1798 appiconSmallTile.scale-150.png
-a----          5.8.2024     15.59           1791 appiconSmallTile.scale-200.png
-a----          5.8.2024     15.59           3477 appiconSmallTile.scale-400.png
-a----          5.8.2024     15.59            907 appiconStoreLogo.scale-100.png
-a----          5.8.2024     15.59            932 appiconStoreLogo.scale-125.png
-a----          5.8.2024     15.59           1181 appiconStoreLogo.scale-150.png
-a----          5.8.2024     15.59           1640 appiconStoreLogo.scale-200.png
-a----          5.8.2024     15.59           2807 appiconStoreLogo.scale-400.png
-a----          5.8.2024     15.59           1971 appiconWideTile.scale-100.png
-a----          5.8.2024     15.59           2799 appiconWideTile.scale-125.png
-a----          5.8.2024     15.59           3779 appiconWideTile.scale-150.png
-a----          5.8.2024     15.59           4009 appiconWideTile.scale-200.png
-a----          5.8.2024     15.59           8148 appiconWideTile.scale-400.png
-a----          8.6.2024      1.08        1042464 CoreMessagingXP.dll
-a----          8.6.2024      1.08        1820704 dcompi.dll
-a----          5.8.2024     15.59          20504 dotnet_bot.scale-100.png
-a----          5.8.2024     15.59          29114 dotnet_bot.scale-125.png
-a----          5.8.2024     15.59          38974 dotnet_bot.scale-150.png
-a----          5.8.2024     15.59          59920 dotnet_bot.scale-200.png
-a----          5.8.2024     15.59         191321 dotnet_bot.scale-400.png
-a----          8.6.2024      1.08        3016736 dwmcorei.dll
-a----          8.6.2024      1.08        2365472 DwmSceneI.dll
-a----          8.6.2024      1.08        3043880 DWriteCore.dll
-a----         18.7.2024      1.33         191408 libEGL.dll
-a----         18.7.2024      1.33        5123112 libGLESv2.dll
-a----         18.7.2024      1.32        9605040 libSkiaSharp.dll
-a----          8.6.2024      1.08         563120 marshal.dll
-a----          8.6.2024      1.08         694304 Microsoft.DirectManipulation.dll
-a----         28.6.2024      1.06          29448 Microsoft.Extensions.Configuration.Abstractions.dll
-a----         28.6.2024      1.06          45328 Microsoft.Extensions.Configuration.dll
-a----         28.6.2024      1.06          66320 Microsoft.Extensions.DependencyInjection.Abstractions.dll
-a----         28.6.2024      1.06          93472 Microsoft.Extensions.DependencyInjection.dll
-a----         28.6.2024      1.06          67232 Microsoft.Extensions.Logging.Abstractions.dll
-a----         28.6.2024      1.06          20144 Microsoft.Extensions.Logging.Debug.dll
-a----         28.6.2024      1.06          52488 Microsoft.Extensions.Logging.dll
-a----         28.6.2024      1.06          66208 Microsoft.Extensions.Options.dll
-a----         28.6.2024      1.05          45344 Microsoft.Extensions.Primitives.dll
-a----          8.6.2024      1.08          11696 Microsoft.Foundation.winmd
-a----         11.3.2024     17.36        1658416 Microsoft.Graphics.Canvas.dll
-a----         11.3.2024     17.36        1111080 Microsoft.Graphics.Canvas.Interop.dll
-a----          8.6.2024      1.08         231456 Microsoft.Graphics.Display.dll
-a----          8.6.2024      1.08          23072 Microsoft.Graphics.winmd
-a----          8.6.2024      1.08         444448 Microsoft.InputStateManager.dll
-a----          7.6.2024      3.23        1325088 Microsoft.InteractiveExperiences.Projection.dll
-a----          8.6.2024      1.08         853288 Microsoft.Internal.FrameworkUdk.dll
-a----         27.6.2024     22.59        1699872 Microsoft.Maui.Controls.dll
-a----         27.6.2024     23.00         133152 Microsoft.Maui.Controls.Xaml.dll
-a----         27.6.2024     23.00         675264 Microsoft.Maui.dll
-a----         27.6.2024     23.02         241184 Microsoft.Maui.Essentials.dll
-a----         27.6.2024     23.02         212400 Microsoft.Maui.Graphics.dll
-a----         27.6.2024     23.02          57264 Microsoft.Maui.Graphics.Win2D.WinUI.Desktop.dll
-a----          8.6.2024      1.08          67616 Microsoft.UI.Composition.OSSupport.dll
-a----          8.6.2024      1.08         120864 Microsoft.UI.dll
-a----          8.6.2024      1.08        1480736 Microsoft.UI.Input.dll
-a----          8.6.2024      1.08          34736 Microsoft.UI.Text.winmd
-a----          8.6.2024      1.08         493600 Microsoft.UI.Windowing.Core.dll
-a----          8.6.2024      1.08         464816 Microsoft.UI.Windowing.dll
-a----          8.6.2024      1.08         298928 Microsoft.UI.winmd
-a----          8.6.2024      1.08        6882344 Microsoft.UI.Xaml.Controls.dll
-a----          8.6.2024      1.08        1229952 Microsoft.UI.Xaml.Controls.pri
-a----          8.6.2024      1.08       15175712 Microsoft.ui.xaml.dll
-a----          8.6.2024      1.08         939552 Microsoft.UI.Xaml.Internal.dll
-a----          8.6.2024      1.08        1094704 Microsoft.UI.Xaml.Phone.dll
-a----          8.6.2024      1.08         566824 Microsoft.ui.xaml.resources.19h1.dll
-a----          8.6.2024      1.08          55840 Microsoft.ui.xaml.resources.common.dll
-a----          8.6.2024      1.08        1611184 Microsoft.UI.Xaml.winmd
-a----          8.6.2024      1.08         714304 Microsoft.Web.WebView2.Core.dll
-a----          8.6.2024      1.08         116296 Microsoft.Web.WebView2.Core.winmd
-a----          7.6.2024     20.05          54192 Microsoft.Windows.ApplicationModel.DynamicDependency.Projection.dll
-a----          8.6.2024      1.08          18480 Microsoft.Windows.ApplicationModel.DynamicDependency.winmd
-a----          8.6.2024      1.08         142880 Microsoft.Windows.ApplicationModel.Resources.dll
-a----          7.6.2024      9.06          69568 Microsoft.Windows.ApplicationModel.Resources.Projection.dll
-a----          8.6.2024      1.08          19376 Microsoft.Windows.ApplicationModel.Resources.winmd
-a----          7.6.2024     20.05          43952 Microsoft.Windows.ApplicationModel.WindowsAppRuntime.Projection.dll
-a----          8.6.2024      1.08          15296 Microsoft.Windows.ApplicationModel.WindowsAppRuntime.winmd
-a----          7.6.2024     20.05          47664 Microsoft.Windows.AppLifecycle.Projection.dll
-a----          8.6.2024      1.08          17344 Microsoft.Windows.AppLifecycle.winmd
-a----          7.6.2024     20.05          73136 Microsoft.Windows.AppNotifications.Builder.Projection.dll
-a----          8.6.2024      1.08          24608 Microsoft.Windows.AppNotifications.Builder.winmd
-a----          7.6.2024     20.05          60848 Microsoft.Windows.AppNotifications.Projection.dll
-a----          8.6.2024      1.08          19888 Microsoft.Windows.AppNotifications.winmd
-a----          7.6.2024     20.05         109600 Microsoft.Windows.Management.Deployment.Projection.dll
-a----          8.6.2024      1.08          34224 Microsoft.Windows.Management.Deployment.winmd
-a----          7.6.2024     20.05          51760 Microsoft.Windows.PushNotifications.Projection.dll
-a----          8.6.2024      1.08          15792 Microsoft.Windows.PushNotifications.winmd
-a----        16.10.2023     22.41       21678632 Microsoft.Windows.SDK.NET.dll
-a----          7.6.2024     20.05          34352 Microsoft.Windows.Security.AccessControl.Projection.dll
-a----          8.6.2024      1.08          12720 Microsoft.Windows.Security.AccessControl.winmd
-a----          7.6.2024     20.05          44976 Microsoft.Windows.System.Power.Projection.dll
-a----          8.6.2024      1.08          17328 Microsoft.Windows.System.Power.winmd
-a----          7.6.2024     20.05          37808 Microsoft.Windows.System.Projection.dll
-a----          8.6.2024      1.08          13872 Microsoft.Windows.System.winmd
-a----          8.6.2024      1.08        2055200 Microsoft.Windows.Widgets.dll
-a----         29.3.2024      1.55         144416 Microsoft.Windows.Widgets.Projection.dll
-a----          8.6.2024      1.08          32288 Microsoft.Windows.Widgets.winmd
-a----          8.6.2024      1.08         391200 Microsoft.WindowsAppRuntime.Bootstrap.dll
-a----          7.6.2024     20.05          16816 Microsoft.WindowsAppRuntime.Bootstrap.Net.dll
-a----          8.6.2024      1.08        1332768 Microsoft.WindowsAppRuntime.dll
-a----          8.6.2024      1.08          38952 Microsoft.WindowsAppRuntime.Insights.Resource.dll
-a----          7.6.2024     20.05        7207856 Microsoft.WinUI.dll
-a----          8.6.2024      1.08         304688 MRM.dll
-a----         20.7.2024     21.15         107168 OpenSans-Regular.ttf
-a----         20.7.2024     21.15         111060 OpenSans-Semibold.ttf
-a----          8.6.2024      1.08          43968 PushNotificationsLongRunningTask.ProxyStub.dll
-a----          5.8.2024     15.59        1266160 resources.pri
-a----          8.6.2024      1.08          86448 RestartAgent.exe
-a----         18.7.2024      1.31         415776 SkiaSharp.dll
-a----         18.7.2024      1.31          25632 SkiaSharp.Views.Maui.Controls.dll
-a----         18.7.2024      1.30          35360 SkiaSharp.Views.Maui.Core.dll
-a----         18.7.2024      1.31          45600 SkiaSharp.Views.Windows.dll
-a----         18.7.2024      1.31          53296 SkiaSharp.Views.WinUI.Native.dll
-a----         18.7.2024      1.31          35360 SkiaSharp.Views.WinUI.Native.Projection.dll
-a----         18.7.2024      0.13           2048 SkiaSharp.Views.WinUI.Native.winmd
-a----          5.8.2024     15.59           4009 splashSplashScreen.scale-100.png
-a----          5.8.2024     15.59           5857 splashSplashScreen.scale-125.png
-a----          5.8.2024     15.59           7559 splashSplashScreen.scale-150.png
-a----          5.8.2024     15.59           8148 splashSplashScreen.scale-200.png
-a----          5.8.2024     15.59          21521 splashSplashScreen.scale-400.png
-a----          8.6.2024      1.08            232 WindowsAppRuntime.png
-a----          8.6.2024      1.08          49944 WindowsAppSdk.AppxDeploymentExtensions.Desktop-EventLog-Instrumentati
                                                  on.dll
-a----          8.6.2024      1.08         624520 WindowsAppSdk.AppxDeploymentExtensions.Desktop.dll
-a----          5.8.2024     15.59          31959 WindowsMauiUnpackagedSKGLViewError.deps.json
-a----          5.8.2024     15.59         207360 WindowsMauiUnpackagedSKGLViewError.dll
-a----          5.8.2024     15.59         259072 WindowsMauiUnpackagedSKGLViewError.exe
-a----          5.8.2024     15.59          47612 WindowsMauiUnpackagedSKGLViewError.pdb
-a----          5.8.2024     15.59            524 WindowsMauiUnpackagedSKGLViewError.runtimeconfig.json
-a----        16.10.2023     22.41         399280 WinRT.Runtime.dll
-a----          8.6.2024      1.08        3397152 WinUIEdit.dll
-a----          8.6.2024      1.08         485408 wuceffectsi.dll
  1. Did you check for any extra activation information being added to the package? In these cases, did you check if they were activatable in an unpackaged application? An example of this is actually the C++ projection. C++/WinRT tries very hard to activate a type, even to the point of falling back to looking for namespace named libraries in the application directory and querying them directly. To give an example from Win2D, this registers itself in the AppxManifest.xml file:

There's no AppxManifest.xml in the unpackaged app.

DarranRowe commented 1 month ago

The unpackaged version doesn't have AppxManifest.xml file.

There's no AppxManifest.xml in the unpackaged app.

The packaged application does. This is where all of the information about dependencies is. The point of these questions was for you to verify the contents of the AppxManifest.xml of the packaged application to make sure there is nothing unexpected in there. If there are extra package dependencies or component registrations, then you can use this information to make sure that you have all of the dependencies and registrations for the unpackaged application.

No, they are quite different.

That comes from the fact that the Windows App SDK is set to self contained, so it is mostly ignorable. The important thing is that the packaged version files are findable.

TommiGustafsson-HMP commented 1 month ago

The unpackaged version doesn't have AppxManifest.xml file.

There's no AppxManifest.xml in the unpackaged app.

The packaged application does. This is where all of the information about dependencies is. The point of these questions was for you to verify the contents of the AppxManifest.xml of the packaged application to make sure there is nothing unexpected in there. If there are extra package dependencies or component registrations, then you can use this information to make sure that you have all of the dependencies and registrations for the unpackaged application.

AppxManifest.xml doesn't have very much information:

<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" IgnorableNamespaces="uap rescap build" xmlns:build="http://schemas.microsoft.com/developer/appx/2015/build">
  <!--
    THIS PACKAGE MANIFEST FILE IS GENERATED BY THE BUILD PROCESS.

    Changes to this file will be lost when it is regenerated. To correct errors in this file, edit the source .appxmanifest file.

    For more information on package manifest files, see http://go.microsoft.com/fwlink/?LinkID=241727
  -->
  <Identity Name="com.companyname.windowsmauiunpackagedskglviewerror" Publisher="CN=User Name" Version="1.0.0.1" ProcessorArchitecture="x64" />
  <mp:PhoneIdentity PhoneProductId="2F086E16-383A-4374-98B7-4B8241A712F4" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
  <Properties>
    <DisplayName>WindowsMauiUnpackagedSKGLViewError</DisplayName>
    <PublisherDisplayName>User Name</PublisherDisplayName>
    <Logo>appiconStoreLogo.png</Logo>
  </Properties>
  <Dependencies>
    <TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
    <TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
    <PackageDependency Name="Microsoft.WindowsAppRuntime.1.5" MinVersion="5001.159.55.0" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" />
  </Dependencies>
  <Resources>
    <Resource Language="EN-US" />
  </Resources>
  <Applications>
    <Application Id="App" Executable="WindowsMauiUnpackagedSKGLViewError.exe" EntryPoint="Windows.FullTrustApplication">
      <uap:VisualElements DisplayName="WindowsMauiUnpackagedSKGLViewError" Description="WindowsMauiUnpackagedSKGLViewError" Square150x150Logo="appiconMediumTile.png" Square44x44Logo="appiconLogo.png" BackgroundColor="transparent">
        <uap:DefaultTile Square71x71Logo="appiconSmallTile.png" Wide310x150Logo="appiconWideTile.png" Square310x310Logo="appiconLargeTile.png" ShortName="WindowsMauiUnpackagedSKGLViewError">
          <uap:ShowNameOnTiles>
            <uap:ShowOn Tile="square150x150Logo" />
            <uap:ShowOn Tile="wide310x150Logo" />
          </uap:ShowNameOnTiles>
        </uap:DefaultTile>
        <uap:SplashScreen Image="splashSplashScreen.png" />
      </uap:VisualElements>
    </Application>
  </Applications>
  <Capabilities>
    <rescap:Capability Name="runFullTrust" />
  </Capabilities>
  <build:Metadata>
    <build:Item Name="Microsoft.UI.Xaml.Markup.Compiler.dll" Version="3.0.0.2406" />
    <build:Item Name="makepri.exe" Version="10.0.22621.755 (WinBuild.160101.0800)" />
  </build:Metadata>
</Package>

No, they are quite different.

That comes from the fact that the Windows App SDK is set to self contained, so it is mostly ignorable. The important thing is that the packaged version files are findable.

Yes, I think .NET MAUI apps are by default self-contained, and I build the unpackaged app on the command line like this:

dotnet build -f:net9.0-windows10.0.19041.0 -c:Release -p:RuntimeIdentifierOverride=win10-x64 -p:WindowsAppSDKSelfContained=true -p:WindowsPackageType=None

DarranRowe commented 1 month ago

The .NET self contained is different from the Windows App SDK self contained. The .NET self contained means that the .NET runtime will be added to the package when you generate the .msix file. This has nothing to do with the Windows App SDK. Setting the Windows App SDK to self contained means that the Windows App Runtime files, such as Microsoft.UI.Xaml.dll are copied into the application directory and registered as Registration Free WinRT. If you remove that declaration and clean the output directory, the Windows App Runtime files will go away.

Well, either way, it seems like I was unable to help you here. I hope you get the help you need quickly.