question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parameter name: The language 'F#' is not supported

See original GitHub issue

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

  1. Make sure Visual Studio 2022 with update 17.3.0 or higher is installed
  2. 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
  1. 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)

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:3
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
WillEhrendreichcommented, Nov 11, 2022

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.

2reactions
TimLarivierecommented, Feb 17, 2023

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

C# Error "Is not supported by the language" after migration ...
On that line of code the error shows on " .TimeZoneInfo " and " .Info " both of type " System.TimeZoneInfo ". Definition...
Read more >
Resolve errors related to language version and features
Several compiler errors indicate that your configured language version doesn't support a feature you're using. This article shows how to fix ...
Read more >
Error "Culture is not supported. Parameter name - SDL Gateway
The issue is present in the XML structure of the file - in this case, the word "mesa" which is part of a...
Read more >
Why do many languages not support named parameters?
Languages that don't allow choosing the externally visible names of a named parameter don't gain much of them if the variable name isn't...
Read more >
Error: "1 is not a supported code page. Parameter name
The following error message appears: 1 is not a supported code page. Parameter name: codepage There is a language mismatch between SQL and ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found