Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.2 Platform Library Template was a WASM build error if ImplicitUsings is disabled. #16657

Closed
BrianDT opened this issue May 9, 2024 · 2 comments · Fixed by #16679
Closed
Assignees
Labels
area/sdk Categorizes an issue or PR as relevant to the Uno.Sdk difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working

Comments

@BrianDT
Copy link

BrianDT commented May 9, 2024

Current behavior

if ImplicitUsings is disabled.
Then the following error is generated

Build started at 17:46...
1>------ Build started: Project: Library_5_2, Configuration: Release Any CPU ------
1>C:\Users\vsoft.nuget\packages\uno.sdk\5.2.108\targets\Uno.Common.Wasm.targets(60,43): error MSB4186: Invalid static method invocation syntax: "[System.String]::Copy().Contains('Microsoft.NET.Sdk.Web')". Method 'System.String.Copy' not found. Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(a, b)). Check that all parameters are defined, are of the correct type, and are specified in the right order.
1>Library_5_2 -> D:\Development\Samples\Uno\Library_5_2\bin\Release\net8.0\Library_5_2.dll
1>Library_5_2 -> D:\Development\Samples\Uno\Library_5_2\bin\Release\net8.0-ios\Library_5_2.dll
1>Library_5_2 -> D:\Development\Samples\Uno\Library_5_2\bin\Release\net8.0-desktop\Library_5_2.dll
1>Library_5_2 -> D:\Development\Samples\Uno\Library_5_2\bin\Release\net8.0-maccatalyst\Library_5_2.dll
1>Library_5_2 -> D:\Development\Samples\Uno\Library_5_2\bin\Release\net8.0-windows10.0.19041\Library_5_2.dll
1>Done building project "Library_5_2.csproj".
1>Library_5_2 -> D:\Development\Samples\Uno\Library_5_2\bin\Release\net8.0-android\Library_5_2.dll
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Build completed at 17:46 and took 00.773 seconds ==========

Expected behavior

The WASM target framework should build correctly

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

Create a new Platform Library project using the 5.2 templates
Include all frameworks
<TargetFrameworks>net8.0;net8.0-ios;net8.0-maccatalyst;net8.0-android;net8.0-windows10.0.19041;net8.0-browserwasm;net8.0-desktop</TargetFrameworks>

In the project file change
<ImplicitUsings>enable</ImplicitUsings>
To
<ImplicitUsings>disable</ImplicitUsings>

Build

Workaround

Remove net8.0-browserwasm or change ImplicitUsings to enabled

Works on UWP/WinUI

Yes

Environment

Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia

NuGet package version(s)

5.2.108

Affected platforms

WebAssembly

IDE

Visual Studio 2022

IDE version

17.9.6

Relevant plugins

None

Anything else we need to know?

No response

@BrianDT BrianDT added difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification labels May 9, 2024
@jeromelaban jeromelaban added area/sdk Categorizes an issue or PR as relevant to the Uno.Sdk and removed triage/untriaged Indicates an issue requires triaging or verification labels May 9, 2024
@Youssef1313
Copy link
Member

@BrianDT A possible workaround is <UnoDisableFilterWebSdkGlobalUsings>true</UnoDisableFilterWebSdkGlobalUsings>.

@BrianDT
Copy link
Author

BrianDT commented May 10, 2024

@Youssef1313 That worked, many thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/sdk Categorizes an issue or PR as relevant to the Uno.Sdk difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants