Reproduction for SKGLView crash on Windows in .NET MAUI when built unpackaged
- Delete
bin
andobj
folders. - Change WindowsPackageType to
None
in the .csproj file. - Build using
dotnet build -f:net9.0-windows10.0.19041.0 -c:Debug
- Start the app by clicking on the exe in bin\Debug\net9.0-windows10.0.19041.0\win10-x64\WindowsMauiUnpackagedSKGLViewError.exe
- App opens as a default MAUI App
- Press Click me button. It tries to open now also GLPage with SKGLView
- App crashes in an exception logged by Event Viewer (in Windows Logs\Application) at SkiaSharp.Views.GlesInterop.Egl.eglGetPlatformDisplayEXT(UInt32, IntPtr, Int32[]); this exception is identified by SentrySDK as System.Exception with message 'Failed to get EGL display'
- If you remove SKGLView from GLPage.xaml, and repeat the process from (1), GLPage opens successfully
- Delete
bin
andobj
folders. - Change WindowsPackageType to
MSIX
in the .csproj file. - Build using
dotnet build -f:net9.0-windows10.0.19041.0 -c:Debug
- Start the app from Visual Studio using Windows Packaged MSIX launch profile.
- App opens as a default MAUI App
- Press Click me button. It tries to open now also GLPage with SKGLView
- App works.