Home
%3CLINGO-SUB%20id%3D%22lingo-sub-376330%22%20slang%3D%22en-US%22%3EUsing%20XAML%20Islands%20on%20Windows%2010%2019H1%3A%20fixing%20the%20%22Catastrophic%20failure%22%20exception%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-376330%22%20slang%3D%22en-US%22%3E%3CP%3EAs%20you%20probably%20know%2C%20the%20AppConsult%20team%20has%20a%20strong%20focus%20on%20Windows%20app%20modernization.%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fuwp%2Fxaml-platform%2Fxaml-host-controls%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EXAML%20Islands%3C%2FA%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eis%20one%20of%20the%20main%20technologies%20we're%20working%20with%20and%20with%20my%20buddy%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Ftwitter.com%2Fsbovo%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3ESebastien%20Bovo%3C%2FA%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Ewe%20have%20delivered%20a%20full%20workshop%20about%20it%20at%20Microsoft%20Ready%2C%20an%20internal%20Microsoft%20event%20which%20gathers%20more%20than%205000%20engineers%20from%20all%20around%20the%20world.%3C%2FP%3E%0A%3CP%3EXAML%20Islands%20is%20one%20of%20the%20technologies%20which%20allows%20to%20modernize%20your%20existing%20WPF%20and%20Windows%20Forms%20applications%20without%20rewriting%20them%20from%20scratch.%20You%20can%20embed%2C%20in%20fact%2C%20controls%20from%20the%20Universal%20Windows%20Platform%20and%2C%20as%20such%2C%20bring%20a%20bit%20of%20Fluent%20design%2C%20touch%20and%20ink%20support%20also%20to%20your%20Win32%20applications.%3C%2FP%3E%0A%3CP%3EThe%20APIs%20which%20make%20XAML%20Islands%20possible%20are%20included%20in%20Windows%2010%2C%20but%20to%20make%20easier%20to%20consume%20them%20the%20Windows%20team%20has%20built%20a%20set%20of%20controls%20which%20have%20been%20included%20in%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fcommunitytoolkit%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EWindows%20Community%20Toolkit%3C%2FA%3E.%20This%20way%2C%20embeedding%20a%20UWP%20control%20in%20your%20Win32%20application%20is%20easy%20as%20dragging%20and%20dropping%20a%20control%20inside%20your%20window%20and%20set%20some%20properties.%3C%2FP%3E%0A%3CP%3EXAML%20Island%20support%20has%20been%20added%20in%20preview%20in%20Windows%201809%2C%20but%20it's%20on%20Windows%2010%2019H1%20(the%20next%20major%20Windows%20update)%20where%20it%20will%20reach%20its%20full%20potential.%20As%20a%20consequence%2C%20I've%20finally%20decided%20to%20make%20the%20switch%20and%20I%20moved%20my%20Surface%20Pro%20to%20the%20Windows%20Insider%20program.%20As%20such%2C%20at%20the%20moment%20of%20writing%2C%20I'm%20now%20running%20Windows%2010%2018358.1.%3C%2FP%3E%0A%3CP%3EHowever%2C%20when%20I%20launched%20the%20application%20me%20and%20Sebastien%20have%20built%20for%20the%20XAML%20Island%20lab%2C%20it%20started%20to%20crash%20when%20I%20was%20opening%20one%20of%20the%20windows%20which%20hosts%20a%20UWP%20control.%20The%20error%20was%20the%20following%20one%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CBLOCKQUOTE%20id%3D%22pragma-line-11%22%3E%0A%3CP%3ESystem.Exception%3A%20'Catastrophic%20failure%20WindowsXamlManager%20and%20DesktopWindowXamlSource%20are%20supported%20for%20apps%20targeting%20Windows%20version%2010.0.18226.0%20and%20later.%20Please%20check%20either%20the%20application%20manifest%20or%20package%20manifest%20and%20ensure%20the%20MaxTestedVersion%20property%20is%20updated.'%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93546i47A582F7DCDB3857%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22exception.png%22%20title%3D%22exception.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAfter%20some%20investigations%20and%20with%20the%20help%20of%20my%20friend%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Ftwitter.com%2FAlexandreChohfi%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAlexandre%3C%2FA%3E%2C%20I've%20found%20two%20ways%20to%20solve%20this%20problem.%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-1483343165%22%20id%3D%22toc-hId-1506279391%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22msix-packaging%22%20id%3D%22toc-hId--1068813796%22%20id%3D%22toc-hId--1045877570%22%3EMSIX%20packaging%3C%2FH3%3E%0A%3CP%3EThe%20first%20way%20to%20solve%20this%20problem%20is%20to%20package%20the%20application%20as%20MSIX%20and%20use%2C%20as%20target%20SDK%2C%20the%2019H1%20one.%20This%20way%2C%20the%20application%20will%20be%20compiled%20with%20the%20newest%20version%20of%20the%20SDK%2C%20which%20includes%20support%20for%20all%20the%20latest%20XAML%20Island%20features%2C%20and%20the%20error%20will%20go%20away.%3C%2FP%3E%0A%3CP%3EAs%20first%20step%2C%20you%20have%20to%20go%20to%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fwww.microsoft.com%2Fen-us%2Fsoftware-download%2FwindowsinsiderpreviewSDK%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.microsoft.com%2Fen-us%2Fsoftware-download%2FwindowsinsiderpreviewSDK%3C%2FA%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Ewebsite%2C%20login%20with%20a%20Microsoft%20Account%20enrolled%20in%20the%20Windows%20Insider%20program%20and%20click%20on%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EGet%20SDK%20Insider%20Preview%3C%2FSTRONG%3E.%20At%20the%20time%20of%20writing%2C%20the%20most%20recent%20SDK%20is%2018351.%20Once%20the%20download%20is%20complete%2C%20double%20click%20on%20the%20ISO%20file%2C%20which%20will%20be%20mounted%20as%20a%20virtual%20drive.%20Open%20it%20in%20File%20Explorer%20and%20double%20click%20on%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EWinSDKSetup.exe%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Efile%20to%20start%20the%20installation.%3C%2FP%3E%0A%3CP%3EOnce%20the%20setup%20is%20finished%2C%20open%20your%20WPF%20or%20Windows%20Forms%20solution%20in%20Visual%20Studio.%20Then%20right%20click%20on%20it%20in%20Solution%20Explorer%20and%20choose%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EAdd%20-%26gt%3B%20New%20project%3C%2FSTRONG%3E.%20If%20you're%20using%20Visual%20Studio%202019%2C%20just%20type%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3Epackaging%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Ein%20the%20search%20box%20to%20find%20the%20Windows%20Application%20Packaging%20Project.%20If%20you're%20using%20Visual%20Studio%202017%2C%20instead%2C%20you%20will%20find%20under%20the%20category%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EC%23%20-%26gt%3B%20Windows%20Universal%3C%2FSTRONG%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93547iB3C18A615974A467%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22packaging%20project.png%22%20title%3D%22packaging%20project.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EAs%20first%20step%2C%20you%20will%20be%20asked%20which%20Windows%2010%20version%20you%20want%20to%20target.%20Make%20sure%20to%20choose%2C%20as%20Target%20version%2C%20the%20Insider%20SDK%20you%20have%20just%20installed%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20603px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93548i908AB5E62F5DED3B%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22insider.png%22%20title%3D%22insider.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EOnce%20the%20project%20has%20been%20created%2C%20identify%20the%26nbsp%3B%3CSTRONG%3EApplications%3C%2FSTRONG%3E%26nbsp%3Bsection%20in%20Solution%20Explorer%20and%20right%20click%20on%20it.%20Choose%26nbsp%3B%3CSTRONG%3EAdd%20reference%3C%2FSTRONG%3E%3A%20Visual%20Studio%20will%20show%20the%20list%20of%20projects%20included%20in%20the%20solution.%20Choose%20the%20one%20which%20contains%20your%20WPF%20%2F%20Windows%20Forms%20application%20and%20press%20OK.%20Now%20your%20application%20has%20been%20packaged.%20If%20you%20set%20the%20new%20project%20as%20startup%20and%20you%20deploy%20it%2C%20you%20will%20actually%20launch%20the%20packaged%20version%20of%20your%20application%20inside%20the%20MSIX%20container.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20344px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93549i870164968AE41699%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22solution%20explorer.png%22%20title%3D%22solution%20explorer.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20now%20try%20to%20open%20a%20windows%20of%20your%20application%20which%20includes%20a%20XAML%20Island%20control%2C%20it%20will%20work%20just%20fine%20and%20you'll%20be%20able%20to%20see%20and%20interact%20with%20it.%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-673996539%22%20id%3D%22toc-hId-696932765%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22add-an-application-manifest%22%20id%3D%22toc-hId--1878160422%22%20id%3D%22toc-hId--1855224196%22%3EAdd%20an%20application%20manifest%3C%2FH3%3E%0A%3CP%3EThe%20second%20option%20is%20to%20add%20an%20application%20manifest%20to%20your%20Win32%20application.%20This%20will%20allow%20to%20leverage%20XAML%20Islands%20without%20having%20to%20package%20your%20application%20as%20MSIX.%20But%20there's%20an%20advantage%20also%20in%20the%20MSIX%20scenario%3A%20you'll%20be%20able%2C%20in%20fact%2C%20to%20package%20your%20application%20but%20still%20target%201809%2C%20without%20having%20to%20install%20the%2019H1%20SDK%20and%20retarget%20the%20app.%3C%2FP%3E%0A%3CP%3ETo%20add%20an%20application%20manifest%2C%20right%20click%20on%20your%20WPF%20or%20Windows%20Forms%20project%20and%20choose%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EAdd%20-%26gt%3B%20New%20item%3C%2FSTRONG%3E.%20Choose%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EXML%20File%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Efrom%20the%20list%2C%20name%20it%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3Eapp.manifest%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eand%20then%20copy%20and%20paste%20the%20following%20content%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20id%3D%22pragma-line-44%22%20class%3D%22language-xml%20hljs%22%3E%3CSPAN%20class%3D%22hljs-meta%22%3E%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22hljs-tag%22%3E%26lt%3B%3CSPAN%20class%3D%22hljs-name%22%3Eassembly%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-attr%22%3EmanifestVersion%3C%2FSPAN%3E%3D%3CSPAN%20class%3D%22hljs-string%22%3E%221.0%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-attr%22%3Exmlns%3C%2FSPAN%3E%3D%3CSPAN%20class%3D%22hljs-string%22%3E%22urn%3Aschemas-microsoft-com%3Aasm.v1%22%3C%2FSPAN%3E%26gt%3B%3C%2FSPAN%3E%0A%20%20%3CSPAN%20class%3D%22hljs-tag%22%3E%26lt%3B%3CSPAN%20class%3D%22hljs-name%22%3Ecompatibility%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-attr%22%3Exmlns%3C%2FSPAN%3E%3D%3CSPAN%20class%3D%22hljs-string%22%3E%22urn%3Aschemas-microsoft-com%3Acompatibility.v1%22%3C%2FSPAN%3E%26gt%3B%3C%2FSPAN%3E%0A%20%20%20%20%3CSPAN%20class%3D%22hljs-tag%22%3E%26lt%3B%3CSPAN%20class%3D%22hljs-name%22%3Eapplication%3C%2FSPAN%3E%26gt%3B%3C%2FSPAN%3E%0A%0A%20%20%20%20%20%20%3CSPAN%20class%3D%22hljs-comment%22%3E%3C!--%20Windows%2010%20--%3E%3C%2FSPAN%3E%0A%20%20%20%20%20%20%3CSPAN%20class%3D%22hljs-tag%22%3E%26lt%3B%3CSPAN%20class%3D%22hljs-name%22%3Emaxversiontested%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-attr%22%3EId%3C%2FSPAN%3E%3D%3CSPAN%20class%3D%22hljs-string%22%3E%2210.0.18358.0%22%3C%2FSPAN%3E%2F%26gt%3B%3C%2FSPAN%3E%0A%20%20%20%20%20%20%3CSPAN%20class%3D%22hljs-tag%22%3E%26lt%3B%3CSPAN%20class%3D%22hljs-name%22%3EsupportedOS%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-attr%22%3EId%3C%2FSPAN%3E%3D%3CSPAN%20class%3D%22hljs-string%22%3E%22%7B8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a%7D%22%3C%2FSPAN%3E%20%2F%26gt%3B%3C%2FSPAN%3E%0A%0A%20%20%20%20%3CSPAN%20class%3D%22hljs-tag%22%3Eapplication%3C%2FSPAN%3E%26gt%3B%0A%20%20%3CSPAN%20class%3D%22hljs-tag%22%3Ecompatibility%3C%2FSPAN%3E%26gt%3B%0A%0A%3CSPAN%20class%3D%22hljs-tag%22%3Eassembly%3C%2FSPAN%3E%26gt%3B%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3EThe%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3Emaxversiontested%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eelement%20inside%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3Eapplication%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Enode%20must%20match%20the%20most%20recent%20available%20version%20of%20Windows%2010%2019H1.%20Ideally%2C%20once%2019H1%20will%20ship%2C%20it%20should%20include%20the%20final%20version%20number.%20For%20the%20moment%2C%20I've%20specified%20the%20most%20recent%20Insider%20build%20at%20the%20time%20of%20writing%2C%20which%20is%2018358.%3C%2FP%3E%0A%3CP%3EThe%20second%20step%20is%20to%20edit%20the%20.csproj%20to%20add%20a%20reference%20to%20the%20manifest%20file%20we%20have%20just%20added.%20We%20can%20do%20this%20through%20the%20visual%20editor.%20Right%20click%20on%20the%20project%20and%20choose%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EProperties%3C%2FSTRONG%3E%2C%20then%20in%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EResources%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Esection%20type%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3Eapp.manifest%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Ein%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EManifest%26nbsp%3B%3C%2FSTRONG%3Efield%2C%20as%20highlighted%20below%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20828px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F93551i18C8997D123CA849%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22appmanifest.png%22%20title%3D%22appmanifest.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThat's%20it!%20Now%20you%20launch%20your%20WPF%20or%20Windows%20Forms%20application%2C%20even%20not%20packaged%20as%20MSIX%2C%20and%20you%20should%20see%20the%20UWP%20controls%20being%20rendered%20just%20fine%2C%20wihout%20any%20other%20catastrophic%20failure%20%3D)%3C%2Fimg%3E%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--135350087%22%20id%3D%22toc-hId--112413861%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22wrapping-up%22%20id%3D%22toc-hId-1607460248%22%20id%3D%22toc-hId-1630396474%22%3EWrapping%20up%3C%2FH3%3E%0A%3CP%3EIn%20this%20post%20we%20have%20seen%20how%20to%20fix%20the%20catastrophic%20failure%20exception%20that%20you%20may%20get%20if%20you%20have%20started%20to%20integrate%20XAML%20Island%20in%20your%20WPF%20and%20Windows%20Forms%20app%20on%20Windows%2010%201809%20and%20then%20you%20moved%20to%2019H1.%20If%20you%20want%20to%20take%20a%20deeper%20look%20to%20XAML%20Islands%2C%20the%20official%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fwindows-toolkit%2FMicrosoft.Toolkit.Win32%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EGitHub%20repository%3C%2FA%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eis%20a%20great%20starting%20point%2C%20since%20it%20contains%20many%20samples%20you%20can%20play%20with.%3C%2FP%3E%0A%3CP%3EHappy%20coding!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-390585%22%20slang%3D%22en-US%22%3ERe%3A%20Using%20XAML%20Islands%20on%20Windows%2010%2019H1%3A%20fixing%20the%20%22Catastrophic%20failure%22%20exception%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-390585%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20and%20thanks%20for%20the%20feedback!%20Let%20me%20try%20to%20address%20your%20questions%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EPartially%20correct.%20XAML%20Islands%20has%20been%20introduced%20in%20Windows%201809%2C%20so%20it%20works%20also%20there.%20However%2C%20in%201809%20it%20has%20been%20released%20as%20a%20preview%20technology%20to%20allow%20developers%20start%20playing%20with%20it%2C%20but%20it%20isn't%20suggested%20to%20be%20used%20in%20production%20environments.%3C%2FLI%3E%0A%3CLI%3EXAML%20Islands%20will%20be%20out%20of%20preview%20in%2019H1%2C%20so%20very%20soon.%20I%20think%20nothing%20is%20blocking%20you%20to%20publish%20an%20application%20on%20the%20Store%20which%20uses%20XAML%20Islands%20right%20now.%20The%20only%20caveat%20is%20that%20you%20need%20to%20test%20it%20very%20well%20and%20make%20sure%20that%20the%20UWP%20controls%20you're%20using%20don't%20introduce%20any%20kind%20of%26nbsp%3B%20instability%20in%20your%20apps.%3C%2FLI%3E%0A%3C%2FOL%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-390545%22%20slang%3D%22en-US%22%3ERe%3A%20Using%20XAML%20Islands%20on%20Windows%2010%2019H1%3A%20fixing%20the%20%22Catastrophic%20failure%22%20exception%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-390545%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F44595%22%20target%3D%22_blank%22%3E%40Matteo%20Pagani%3C%2FA%3E%26nbsp%3B-%20Thanks%20for%20this%20post.%20I've%20been%20following%20the%20work%20from%20the%20app%20consult%20team%20very%20closely%20as%20I%20love%20using%20the%20new%20technologies%20you%20all%20come%20out%20with%20for%20UWP.%20I%20ran%20into%20this%20error%20after%20upgrading%20my%20Windows%20to%2019H1%20and%20I've%20since%20halted%20development%20on%20upgrading%20my%20desktop%20bridge%20app(s)%20to%20use%20XAML%20Islands%20since%20I've%20had%20numerous%20issues%20using%20the%20preview%20and%20it%20didn't%20seem%20worth%20it%20to%20continue%20developing%20for%20an%20OS%20release%20version%20that%20most%20of%20my%20users%20will%20not%20use%20for%20a%20while.%20However%2C%20I'm%20very%20glad%20to%20see%20work%20is%20still%20being%20put%20into%20these%20technologies.%20I%20have%20a%20couple%20questions%20which%20may%20affect%20the%20priority%20of%20the%20work%20in%20my%20apps%20and%20maybe%20you%20can%20answer%20them%20for%20me%3A%3CBR%20%2F%3E1.%20If%20I'm%20required%20to%20also%20upgrade%20my%20package%20to%20build%2018351%2C%20does%20that%20mean%20there%20will%20never%20be%20support%20for%20XAML%20islands%20earlier%20than%20that%20build%20(like%20for%20OS%20version%201809)%3F%3CBR%20%2F%3E2.%20When%20is%20XAML%20island's%20anticipated%20release%20date%20and%20when%20can%20I%20expect%20to%20be%20publishing%20apps%20with%20XAML%20islands%20to%20the%20Windows%20Store%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E
Microsoft

As you probably know, the AppConsult team has a strong focus on Windows app modernization. XAML Islands is one of the main technologies we're working with and with my buddy Sebastien Bovo we have delivered a full workshop about it at Microsoft Ready, an internal Microsoft event which gathers more than 5000 engineers from all around the world.

XAML Islands is one of the technologies which allows to modernize your existing WPF and Windows Forms applications without rewriting them from scratch. You can embed, in fact, controls from the Universal Windows Platform and, as such, bring a bit of Fluent design, touch and ink support also to your Win32 applications.

The APIs which make XAML Islands possible are included in Windows 10, but to make easier to consume them the Windows team has built a set of controls which have been included in the Windows Community Toolkit. This way, embeedding a UWP control in your Win32 application is easy as dragging and dropping a control inside your window and set some properties.

XAML Island support has been added in preview in Windows 1809, but it's on Windows 10 19H1 (the next major Windows update) where it will reach its full potential. As a consequence, I've finally decided to make the switch and I moved my Surface Pro to the Windows Insider program. As such, at the moment of writing, I'm now running Windows 10 18358.1.

However, when I launched the application me and Sebastien have built for the XAML Island lab, it started to crash when I was opening one of the windows which hosts a UWP control. The error was the following one:

 

System.Exception: 'Catastrophic failure WindowsXamlManager and DesktopWindowXamlSource are supported for apps targeting Windows version 10.0.18226.0 and later. Please check either the application manifest or package manifest and ensure the MaxTestedVersion property is updated.'

exception.png

 

After some investigations and with the help of my friend Alexandre, I've found two ways to solve this problem.

 

MSIX packaging

The first way to solve this problem is to package the application as MSIX and use, as target SDK, the 19H1 one. This way, the application will be compiled with the newest version of the SDK, which includes support for all the latest XAML Island features, and the error will go away.

As first step, you have to go to the https://www.microsoft.com/en-us/software-download/windowsinsiderpreviewSDK website, login with a Microsoft Account enrolled in the Windows Insider program and click on Get SDK Insider Preview. At the time of writing, the most recent SDK is 18351. Once the download is complete, double click on the ISO file, which will be mounted as a virtual drive. Open it in File Explorer and double click on the WinSDKSetup.exe file to start the installation.

Once the setup is finished, open your WPF or Windows Forms solution in Visual Studio. Then right click on it in Solution Explorer and choose Add -> New project. If you're using Visual Studio 2019, just type packaging in the search box to find the Windows Application Packaging Project. If you're using Visual Studio 2017, instead, you will find under the category C# -> Windows Universal.

 

packaging project.png

 

As first step, you will be asked which Windows 10 version you want to target. Make sure to choose, as Target version, the Insider SDK you have just installed:

 

insider.png

 

Once the project has been created, identify the Applications section in Solution Explorer and right click on it. Choose Add reference: Visual Studio will show the list of projects included in the solution. Choose the one which contains your WPF / Windows Forms application and press OK. Now your application has been packaged. If you set the new project as startup and you deploy it, you will actually launch the packaged version of your application inside the MSIX container.

 

solution explorer.png

 

If you now try to open a windows of your application which includes a XAML Island control, it will work just fine and you'll be able to see and interact with it.

 

Add an application manifest

The second option is to add an application manifest to your Win32 application. This will allow to leverage XAML Islands without having to package your application as MSIX. But there's an advantage also in the MSIX scenario: you'll be able, in fact, to package your application but still target 1809, without having to install the 19H1 SDK and retarget the app.

To add an application manifest, right click on your WPF or Windows Forms project and choose Add -> New item. Choose XML File from the list, name it app.manifest and then copy and paste the following content:

 

<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
  <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
    <application>

      <!-- Windows 10 -->
      <maxversiontested Id="10.0.18358.0"/>
      <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />

    </application>
  </compatibility>

</assembly>

The maxversiontested element inside the application node must match the most recent available version of Windows 10 19H1. Ideally, once 19H1 will ship, it should include the final version number. For the moment, I've specified the most recent Insider build at the time of writing, which is 18358.

The second step is to edit the .csproj to add a reference to the manifest file we have just added. We can do this through the visual editor. Right click on the project and choose Properties, then in the Resources section type app.manifest in the Manifest field, as highlighted below:

 

appmanifest.png

 

That's it! Now you launch your WPF or Windows Forms application, even not packaged as MSIX, and you should see the UWP controls being rendered just fine, wihout any other catastrophic failure =)

 

Wrapping up

In this post we have seen how to fix the catastrophic failure exception that you may get if you have started to integrate XAML Island in your WPF and Windows Forms app on Windows 10 1809 and then you moved to 19H1. If you want to take a deeper look to XAML Islands, the official GitHub repository is a great starting point, since it contains many samples you can play with.

Happy coding!

2 Comments
Occasional Visitor

@Matteo Pagani - Thanks for this post. I've been following the work from the app consult team very closely as I love using the new technologies you all come out with for UWP. I ran into this error after upgrading my Windows to 19H1 and I've since halted development on upgrading my desktop bridge app(s) to use XAML Islands since I've had numerous issues using the preview and it didn't seem worth it to continue developing for an OS release version that most of my users will not use for a while. However, I'm very glad to see work is still being put into these technologies. I have a couple questions which may affect the priority of the work in my apps and maybe you can answer them for me:
1. If I'm required to also upgrade my package to build 18351, does that mean there will never be support for XAML islands earlier than that build (like for OS version 1809)?
2. When is XAML island's anticipated release date and when can I expect to be publishing apps with XAML islands to the Windows Store?

Microsoft

Hello and thanks for the feedback! Let me try to address your questions:

 

  1. Partially correct. XAML Islands has been introduced in Windows 1809, so it works also there. However, in 1809 it has been released as a preview technology to allow developers start playing with it, but it isn't suggested to be used in production environments.
  2. XAML Islands will be out of preview in 19H1, so very soon. I think nothing is blocking you to publish an application on the Store which uses XAML Islands right now. The only caveat is that you need to test it very well and make sure that the UWP controls you're using don't introduce any kind of  instability in your apps.