Precompiled Microsoft.UI.Xaml.Application
compatible with the F# MAUI template.
- Add the
FSharp.Maui.WinUICompat
NuGet package to your F# MAUI project under theWindows
ItemGroup
<ItemGroup Condition="$(TargetPlatformIdentifier) == 'windows'">
(...)
<PackageReference Include="FSharp.Maui.WinUICompat" Version="1.0.0" />
</ItemGroup>
- In the file
Platforms\Windows\App.fs
, change the inherited class toFSharp.Maui.WinUICompat.App
type App() =
- inherit MauiWinUIApplication()
+ inherit FSharp.Maui.WinUICompat.App()
- Create the file
Platforms\Windows\Main.fs
, add the following code
module Program =
[<EntryPoint>]
[<STAThread>]
let main args =
do FSharp.Maui.WinUICompat.Program.Main(args, typeof<YourApp.WinUI.App>)
0
Where YourApp.WinUI.App
is the App
class defined in step 2