-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
I'm trying to use System.Text.Json
in a WASM project, but I have the following error at runtime.
Could not load signature of System.Text.Json.Serialization.JsonConverter`1[T]:Write due to: Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies.
It appears that System.Text.Json
has a dependency to Microsoft.Bcl.AsyncInterfaces
.
If I add an explicit reference to Microsoft.Bcl.AsyncInterfaces
and try to resolve any of its types (e.g. IAsyncDisposable
) , the WASM app stops working the moment I resolve the type.
Steps to reproduce the issue:
- Add a reference to
Microsoft.Bcl.AsyncInterfaces
.
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="1.0.0" />
- In the
Main
method ofProgram.cs
ofUno.Wasm.Sample
, have the following code.
static void Main(string[] args)
{
Console.WriteLine($"Mono Runtime Mode: " + Environment.GetEnvironmentVariable("UNO_BOOTSTRAP_MONO_RUNTIME_MODE"));
var i = 42;
var now = DateTime.Now.ToString();
Console.WriteLine($"Main! {i} {now}");
try
{
Console.WriteLine("Getting type from Microsoft.Bcl.AsyncInterfaces");
var t = typeof(IAsyncDisposable);
Console.WriteLine("Success!");
}
catch (Exception e)
{
Console.WriteLine("Something went wrong!" + e.Message);
}
}
- Run the app and observe that in the console you get "Getting type from Microsoft.Bcl.AsyncInterfaces" but not "Success!" nor the "Something went wrong" message. There is no error in the output, it simply breaks.
Metadata
Metadata
Assignees
Labels
No labels