Skip to content

Added WASM head to XF project can't compile due to various errors #3882

Closed

Description

@MartinZikmund

Current behavior

Expected behavior

How to reproduce it (as minimally and precisely as possible)

  • Create blank XF app including UWP, but with projects not in the same folder as solution
  • Use dotnet new wasmxfhead
  • See the WASM project is properly added to the solution although in nested folder:

image

  • Try to build the project
  • Observe error

Severity Code Description Project File Line Suppression State
Error NETSDK1022 Duplicate 'EmbeddedResource' items were included. The .NET SDK includes 'EmbeddedResource' items from your project directory by default. You can either remove these items from your project file, or set the 'EnableDefaultEmbeddedResourceItems' property to 'false' if you want to explicitly include them in your project file. For more information, see https://aka.ms/sdkimplicititems. The duplicate items were: 'WasmCSS\Fonts.css' App27.Wasm C:\Program Files\dotnet\sdk\3.1.401\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.DefaultItems.targets 306

  • Comment out embedded resources in csproj
  • Build the project
  • Observe error

Severity Code Description Project File Line Suppression State
Error CS0234 The type or namespace name 'BindableMetadataProvider' does not exist in the namespace 'App27.Wasm' (are you missing an assembly reference?) App27.Wasm C:\Users\marti\source\repos\App27\App27\App27.Wasm\obj\Debug\netstandard2.0\g\XamlCodeGenerator\App_85b143a515683d85392f17f7ce8b8b95.g.cs 74 Active

Environment

Nuget Package:

Package Version(s):

Affected platform(s):

  • iOS
  • Android
  • WebAssembly
  • WebAssembly renderers for Xamarin.Forms
  • macOS
  • Windows
  • Build tasks
  • Solution Templates

Visual Studio:

  • 2017 (version: )
  • 2019 (version: )
  • for Mac (version: )

Relevant plugins:

  • Resharper (version: )

Anything else we need to know?

Activity

  1. added
    kind/bug
    triage/untriaged
    on Aug 25, 2020
  2. added this to the 3.1 milestone on Aug 28, 2020
  3. removed
    triage/untriaged
    on Aug 28, 2020
  4. removed this from the 3.1 milestone on Aug 30, 2020
  5. said-akram commented on Sep 11, 2020

    @said-akram

    Hi @jeromelaban
    Is there a workaround for this issue?
    Thanks

  6. traxium commented on Sep 20, 2020

    @traxium

    I have the same errors. Adding <EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems> doesn't help.

  7. AswinPG commented on Sep 21, 2020

    @AswinPG

    How to solve this ...?

  8. craig-xarios commented on Sep 21, 2020

    @craig-xarios

    I was having the same error in a test project
    "The type or namespace name 'BindableMetadataProvider' does not exist in the namespace"

    Adding the package Uno.UI.WebAssembly to my test project fixed it

  9. added
    project/third-party 3️⃣
    on Sep 21, 2020
  10. jeromelaban commented on Sep 21, 2020

    @jeromelaban
    Member

    This issue is related to the use of an incompatible version of Xamarin.Forms. The currently published version of Xamarin.Forms renderers for Uno only supports Xamarin.Forms 4.5.0.356. We're working to get to 4.8 which will solve this issue.

  11. VictorKochetkov commented on Sep 26, 2020

    @VictorKochetkov

    This issue is related to the use of an incompatible version of Xamarin.Forms. The currently published version of Xamarin.Forms renderers for Uno only supports Xamarin.Forms 4.5.0.356. We're working to get to 4.8 which will solve this issue.

    Unfortunately, I have this issue with Xamarin.Forms 4.5.0.356 installed(

  12. palbordoy commented on Sep 27, 2020

    @palbordoy

    Me too :(

  13. said-akram commented on Sep 30, 2020

    @said-akram

    Hi I have the same issue.
    Created a new Xamarin.Forms app then run dotnet new wasmxfhead
    I have the following errors

    1>------ Rebuild All started: Project: UnoTestXamarin, Configuration: Debug Any CPU ------ 1>UnoTestXamarin -> C:\Users\abc\source\repos\UnoTestXamarin\UnoTestXamarin\bin\Debug\netstandard2.0\UnoTestXamarin.dll 2>------ Rebuild All started: Project: UnoTestXamarin.Wasm, Configuration: Debug Any CPU ------ 2>C:\Users\abc\source\repos\UnoTestXamarin\UnoTestXamarin.UWP\App.xaml.cs(45,17,45,58): warning Uno0001: Windows.UI.Xaml.DebugSettings.EnableFrameRateCounter is not implemented in Uno 2>UnoTestXamarin.Wasm -> C:\Users\abc\source\repos\UnoTestXamarin\UnoTestXamarin.Wasm\bin\Debug\netstandard2.0\UnoTestXamarin.Wasm.dll 2>C:\Users\abc\.nuget\packages\uno.wasm.bootstrap\1.3.4\build\Uno.Wasm.Bootstrap.targets(126,2): error : [00:00:09.6268750] Fatal error in Mono IL Linker 2>C:\Users\abc\.nuget\packages\uno.wasm.bootstrap\1.3.4\build\Uno.Wasm.Bootstrap.targets(126,2): error : [00:00:09.6289206] 2>C:\Users\abc\.nuget\packages\uno.wasm.bootstrap\1.3.4\build\Uno.Wasm.Bootstrap.targets(126,2): error : [00:00:09.6320495] Unhandled Exception: Mono.Cecil.ResolutionException: Failed to resolve Uno.Diagnostics.Eventing.IEventProvider 2>C:\Users\abc\.nuget\packages\uno.wasm.bootstrap\1.3.4\build\Uno.Wasm.Bootstrap.targets(126,2): error : [00:00:09.6320769] at Mono.Linker.Steps.MarkStep.HandleUnresolvedType(TypeReference reference) 2>C:\Users\abc\.nuget\packages\uno.wasm.bootstrap\1.3.4\build\Uno.Wasm.Bootstrap.targets(126,2): error : [00:00:09.6320800] at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference) 2>C:\Users\abc\.nuget\packages\uno.wasm.bootstrap\1.3.4\build\Uno.Wasm.Bootstrap.targets(126,2): error : [00:00:09.6320844] at Mono.Linker.Steps.MarkStep.MarkField(FieldDefinition field) 2>C:\Users\abc\.nuget\packages\uno.wasm.bootstrap\1.3.4\build\Uno.Wasm.Bootstrap.targets(126,2): error : [00:00:09.6320868] at Mono.Linker.Steps.MarkStep.MarkFields(TypeDefinition type, Boolean includeStatic, Boolean markBackingFieldsOnlyIfPropertyMarked) 2>C:\Users\abc\.nuget\packages\uno.wasm.bootstrap\1.3.4\build\Uno.Wasm.Bootstrap.targets(126,2): error : [00:00:09.6320893] at Mono.Linker.Steps.MarkStep.ApplyPreserveInfo(TypeDefinition type) 2>C:\Users\abc\.nuget\packages\uno.wasm.bootstrap\1.3.4\build\Uno.Wasm.Bootstrap.targets(126,2): error : [00:00:09.6320916] at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference) 2>C:\Users\abc\.nuget\packages\uno.wasm.bootstrap\1.3.4\build\Uno.Wasm.Bootstrap.targets(126,2): error : [00:00:09.6320940] at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference) 2>C:\Users\abc\.nuget\packages\uno.wasm.bootstrap\1.3.4\build\Uno.Wasm.Bootstrap.targets(126,2): error : [00:00:09.6320964] at Mono.Linker.Steps.MarkStep.InitializeType(TypeDefinition type) 2>C:\Users\abc\.nuget\packages\uno.wasm.bootstrap\1.3.4\build\Uno.Wasm.Bootstrap.targets(126,2): error : [00:00:09.6320987] at Mono.Linker.Steps.MarkStep.InitializeType(TypeDefinition type) 2>C:\Users\abc\.nuget\packages\uno.wasm.bootstrap\1.3.4\build\Uno.Wasm.Bootstrap.targets(126,2): error : [00:00:09.6321011] at Mono.Linker.Steps.MarkStep.InitializeAssembly(AssemblyDefinition assembly) 2>C:\Users\abc\.nuget\packages\uno.wasm.bootstrap\1.3.4\build\Uno.Wasm.Bootstrap.targets(126,2): error : [00:00:09.6321034] at Mono.Linker.Steps.MarkStep.Initialize() 2>C:\Users\abc\.nuget\packages\uno.wasm.bootstrap\1.3.4\build\Uno.Wasm.Bootstrap.targets(126,2): error : [00:00:09.6321057] at Mono.Linker.Steps.MarkStep.Process(LinkContext context) 2>C:\Users\abc\.nuget\packages\uno.wasm.bootstrap\1.3.4\build\Uno.Wasm.Bootstrap.targets(126,2): error : [00:00:09.6321329] at Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step) 2>C:\Users\abc\.nuget\packages\uno.wasm.bootstrap\1.3.4\build\Uno.Wasm.Bootstrap.targets(126,2): error : [00:00:09.6321367] at Mono.Linker.Pipeline.Process(LinkContext context) 2>C:\Users\abc\.nuget\packages\uno.wasm.bootstrap\1.3.4\build\Uno.Wasm.Bootstrap.targets(126,2): error : [00:00:09.6321393] at Mono.Linker.Driver.Run(ILogger customLogger) 2>C:\Users\abc\.nuget\packages\uno.wasm.bootstrap\1.3.4\build\Uno.Wasm.Bootstrap.targets(126,2): error : [00:00:09.6321415] at Mono.Linker.Driver.Execute(String[] args, ILogger customLogger) 2>C:\Users\abc\.nuget\packages\uno.wasm.bootstrap\1.3.4\build\Uno.Wasm.Bootstrap.targets(126,2): error : [00:00:09.6321441] at Mono.Linker.Driver.Main(String[] args) 2>C:\Users\abc\.nuget\packages\uno.wasm.bootstrap\1.3.4\build\Uno.Wasm.Bootstrap.targets(126,2): error : System.Exception: Failed to execute the linker 2>C:\Users\abc\.nuget\packages\uno.wasm.bootstrap\1.3.4\build\Uno.Wasm.Bootstrap.targets(126,2): error : at Uno.Wasm.Bootstrap.ShellTask_v2ed6794b633a8ebf33d51d6d21f9d6a587ebe09e.RunPackager() in D:\a\1\s\src\Uno.Wasm.Bootstrap\ShellTask.cs:line 709 2>C:\Users\abc\.nuget\packages\uno.wasm.bootstrap\1.3.4\build\Uno.Wasm.Bootstrap.targets(126,2): error : at Uno.Wasm.Bootstrap.ShellTask_v2ed6794b633a8ebf33d51d6d21f9d6a587ebe09e.Execute() in D:\a\1\s\src\Uno.Wasm.Bootstrap\ShellTask.cs:line 182 2>Done building project "UnoTestXamarin.Wasm.csproj" -- FAILED. ========== Rebuild All: 1 succeeded, 1 failed, 0 skipped ==========

    I attached my solution
    UnoTestXamarin.zip

    Thanks

  14. added
    area/xf-wasm-renderers
    on Oct 1, 2020
  15. jeromelaban commented on Oct 5, 2020

    @jeromelaban
    Member

    This issue is closed as this fixes the issue mentioned in this thread, but there are remaining issues pertaining to the Xamarin.Forms 4.8 release, particularly #4170.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/xf-wasm-rendererskind/bugproject/third-party 3️⃣

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions