5.2 Platform Library Template was a WASM build error if ImplicitUsings is disabled. #16657
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
Current behavior
if ImplicitUsings is disabled.
Then the following error is generated
Build started at 17:46...$([FullTypeName]::Method()), e.g. $ ([System.IO.Path]::Combine(
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:
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
The text was updated successfully, but these errors were encountered: