maui
maui copied to clipboard
Parameter name: The language 'F#' is not supported
Description
When trying to compile the FSharp.Mobile.Templates's MAUI template, compilation with Visual Studio on Windows fails with the error:
Xaml Internal Error error WMC9999: Specified argument was out of the range of valid values.
Xaml Internal Error error WMC9999: Parameter name: The language 'F#' is not supported
According to macOS users, it compiles on macOS normally though. Therefore, it seems to be a bug within MAUI itself.
Steps to Reproduce
- Make sure Visual Studio 2022 with update 17.3.0 or higher is installed
- Install the required workloads via
dotnet workload install android
dotnet workload install ios
dotnet workload install maccatalyst
dotnet workload install maui
and project templates via via
dotnet new -i FSharp.Mobile.Templates
(See FSharp.Mobile.Templates for more details)
3. Create a project via dotnet new maui-fsharp -n MyMauiFsharp
4. Build via
cd MyMauiFsharp
dotnet build MyMauiFsharp.sln
- Notice the error messages
Version with bug
6.0.400
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
Windows SDK 10.0.19041.0
Did you find any workaround?
Compiling on macOS works according to this comment.
Relevant log output
dotnet build MyMauiFsharp.sln
MSBuild version 17.3.0+92e077650 for .NET
Determining projects to restore...
Restored d:\Softdev\Test\MyMauiFsharp\MyMauiFsharp.fsproj (in 777 ms).
EXEC : Xaml Internal error : Specified argument was out of the range of valid values. [d:\Softdev\Test\MyMauiFsharp\MyM
auiFsharp.fsproj]
Parameter name: The language 'F#' is not supported
C:\Users\Win11\.nuget\packages\microsoft.windowsappsdk\1.1.3\buildTransitive\Microsoft.UI.Xaml.Markup.Compiler.interop.
targets(559,9): error MSB3073: The command ""C:\Users\Win11\.nuget\packages\microsoft.windowsappsdk\1.1.3\buildTransiti
ve\..\tools\net5.0\..\net472\XamlCompiler.exe" "obj\Debug\net6.0-windows10.0.19041.0\win10-x64\\input.json" "obj\Debug\
net6.0-windows10.0.19041.0\win10-x64\\output.json"" exited with code 1. [d:\Softdev\Test\MyMauiFsharp\MyMauiFsharp.fspr
oj]
MyMauiFsharp -> d:\Softdev\Test\MyMauiFsharp\bin\Debug\net6.0-maccatalyst\maccatalyst-x64\MyMauiFsharp.dll
MyMauiFsharp -> d:\Softdev\Test\MyMauiFsharp\bin\Debug\net6.0-ios\iossimulator-x64\MyMauiFsharp.dll
d:\Softdev\Test\MyMauiFsharp\Platforms\Android\MainApplication.fs(10,21): error FS0039: The value, constructor, namespa
ce or type 'Resource' is not defined. [d:\Softdev\Test\MyMauiFsharp\MyMauiFsharp.fsproj]
Build FAILED.
EXEC : Xaml Internal error : Specified argument was out of the range of valid values. [d:\Softdev\Test\MyMauiFsharp\MyM
auiFsharp.fsproj]
C:\Users\Win11\.nuget\packages\microsoft.windowsappsdk\1.1.3\buildTransitive\Microsoft.UI.Xaml.Markup.Compiler.interop.
targets(559,9): error MSB3073: The command ""C:\Users\Win11\.nuget\packages\microsoft.windowsappsdk\1.1.3\buildTransiti
ve\..\tools\net5.0\..\net472\XamlCompiler.exe" "obj\Debug\net6.0-windows10.0.19041.0\win10-x64\\input.json" "obj\Debug\
net6.0-windows10.0.19041.0\win10-x64\\output.json"" exited with code 1. [d:\Softdev\Test\MyMauiFsharp\MyMauiFsharp.fspr
oj]
d:\Softdev\Test\MyMauiFsharp\Platforms\Android\MainApplication.fs(10,21): error FS0039: The value, constructor, namespa
ce or type 'Resource' is not defined. [d:\Softdev\Test\MyMauiFsharp\MyMauiFsharp.fsproj]
0 Warning(s)
3 Error(s)
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
Where can I find out what the plan is for enabling fsharp with MAUI on windows? I can't find a roadmap with this, and I can't be the only one interested haha.
Running into the same issue and would love to know when this is expected to be addressed. Is this supported om Linux or is MacOS the only option atm?
Any plans to address this issue? Still a problem for Fabulous.MauiControls when trying to build on PC.
Forgot to post it here, but with the help of @PureWeen, we found a workaround to allow building Maui WinUI apps with F#. More informations at https://github.com/fabulous-dev/FSharp.Maui.WinUICompat
Both FSharp.Mobile.Templates and Fabulous.MauiControls.Templates have been updated with this fix.
@PureWeen is there something we can still fix on our end? Or is this outside of our control?
Verified this issue with Visual Studio Enterprise 17.8.0 Preview 2.0. Can repro this issue.