unoplatform / uno

Build Mobile, Desktop and WebAssembly apps with C# and XAML. Today. Open source and professionally supported.
https://platform.uno
Apache License 2.0
8.45k stars 685 forks source link

On library projects global.json does not work for WASM if it is not in the same directory as the csproj #16524

Closed ADD-David-Antolin closed 2 weeks ago

ADD-David-Antolin commented 2 weeks ago

Current behavior

Library project does not compile on wasm target if the global.json is not in the same directory as .csproj (Uno.Sdk 5.2.108).

Expected behavior

Library project compiles on wasm target if the global.json is in a parent directory of .csproj (it was working in Uno.Sdk 5.2.95).

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

UnoLibraryGlobalJsonBug.zip

Unzip the minimal repro project and compile the solution. UnoLibrary1 project, which has global.json in parent directory will throw a build error on wasm target and UnoLibrary2 project, which has global.json in same directory as the .csproj will not.

In the same zip are the binlogs.

Workaround

Create a global.json in each directory that contains a .csproj with Uno.Sdk and <OutputType>Library</OutputType>.

Works on UWP/WinUI

Yes

Environment

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

NuGet package version(s)

Uno.Sdk 5.2.108

Affected platforms

WebAssembly

IDE

Visual Studio 2022

IDE version

17.9.6

Relevant plugins

No response

Anything else we need to know?

No response

agneszitte commented 2 weeks ago

cc @jeromelaban

jeromelaban commented 2 weeks ago

Thanks for the report. A workaround is to add any file in a folder named Assets. We'll make a backport to uno 5.2 very soon.