maui icon indicating copy to clipboard operation
maui copied to clipboard

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

Open ChristophSchmidpeter opened this issue 3 years ago • 2 comments

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)

ChristophSchmidpeter avatar Aug 12 '22 19:08 ChristophSchmidpeter

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.

ghost avatar Aug 15 '22 08:08 ghost

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.

WillEhrendreich avatar Nov 11 '22 16:11 WillEhrendreich

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?

dlouwers avatar Nov 14 '22 22:11 dlouwers

Any plans to address this issue? Still a problem for Fabulous.MauiControls when trying to build on PC.

reigam avatar Jan 14 '23 22:01 reigam

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.

TimLariviere avatar Feb 17 '23 07:02 TimLariviere

@PureWeen is there something we can still fix on our end? Or is this outside of our control?

jfversluis avatar Mar 18 '23 15:03 jfversluis

Verified this issue with Visual Studio Enterprise 17.8.0 Preview 2.0. Can repro this issue. image

homeyf avatar Sep 25 '23 07:09 homeyf