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

[Wasm] Add .NET 5 interpreter support #4322

Closed
jeromelaban opened this issue Mar 30, 2020 · 6 comments
Closed

[Wasm] Add .NET 5 interpreter support #4322

jeromelaban opened this issue Mar 30, 2020 · 6 comments
Labels
platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform project/core-tools 🛠️ Categorizes an issue or PR as relevant to core and tools

Comments

@jeromelaban
Copy link
Member

jeromelaban commented Mar 30, 2020

The bootstrapper is now yet compatible with .NET5 target frameworks, as the mono CI does not bundle the proper libraries.

This issue is about adding support for .NET 5 runtime support for the interpreter only.

@jeromelaban jeromelaban changed the title Add support for netcoreapp 3.2 or 5 Add support for netcoreapp3.2 or net5 Mar 30, 2020
@tomasfabian
Copy link

tomasfabian commented Jun 15, 2020

Is this issue also relevant for .netstandard2.1 apps? I tried to apply it for a Blazor 3.2 WebAssembly app, but the Uno.Wasm.Bootstrap assembly wasn't loaded by the browser (I also tried Ctrl+Shift+R)

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netstandard2.1</TargetFramework>
    <RazorLangVersion>3.0</RazorLangVersion>

    <MonoWasmRuntimeConfiguration>threads-release</MonoWasmRuntimeConfiguration>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)'=='Debug'">
    <MonoRuntimeDebuggerEnabled>true</MonoRuntimeDebuggerEnabled>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="3.2.0" />
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Build" Version="3.2.0" PrivateAssets="all" />
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="3.2.0" PrivateAssets="all" />
    <PackageReference Include="System.Net.Http.Json" Version="3.2.1" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Uno.Wasm.Bootstrap" Version="1.3.0-dev.42" />
    <PackageReference Include="Uno.Wasm.Bootstrap.DevServer" Version="1.3.0-dev.42" PrivateAssets="all" />
  </ItemGroup>

  <!--<PropertyGroup Condition="'$(Configuration)'=='Debug'">
    <DebugType>portable</DebugType>
    <DebugSymbols>true</DebugSymbols>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)'=='Debug'">
    <DefineConstants>$(DefineConstants);TRACE;DEBUG</DefineConstants>
  </PropertyGroup>-->

</Project>

Chrome versions is: Version 83.0.4103.97 (Official Build) (64-bit)

The Run method from this example webassembly-threading-in-net throws an error:
System.NotSupportedException: Cannot start threads on this runtime.

@jeromelaban
Copy link
Member Author

Thanks @tomasfabian. Could you provide the full error you're getting ?

@tomasfabian
Copy link

of course, this is from the VS output, is it good enough?:

_System.NotSupportedException: Cannot start threads on this runtime.
at (wrapper managed-to-native) System.Threading.Thread.Thread_internal(System.Threading.Thread,System.MulticastDelegate)
at System.Threading.Thread.StartInternal (System.Object principal, System.Threading.StackCrawlMark& stackMark) <0x30f0290 + 0x00008> in :0
at System.Threading.Thread.Start (System.Threading.StackCrawlMark& stackMark) <0x30f0128 + 0x0004e> in :0
at System.Threading.Thread.Start () <0x30eff70 + 0x0000e> in :0
at Joker.BlazorApp.Sample.Program.RunAsync () [0x00065] in C:\Users\tomas.fabian\source\repos\Joker.BlazorApp.Sample\Joker.BlazorApp.Sample\Program.cs:89
at Joker.BlazorApp.Sample.Program.Main (System.String[] args) [0x000b3] in C:\Users\tomas.fabian\source\repos\Joker.BlazorApp.Sample\Joker.BlazorApp.Sample\Program.cs:196
at Microsoft.AspNetCore.Components.WebAssembly.Hosting.EntrypointInvoker.InvokeEntrypoint (System.String assemblyName, System.String[] args) <0x2df00c0 + 0x0012c> in :0_

@jeromelaban
Copy link
Member Author

This looks like an issue with the runtime not being able to create threads, rather than the bootstrapper itself. Do you need to create a thread for your app, or is it just for testing ? Threading is still a work in progress at this point.

@tomasfabian
Copy link

I wanted to solve my threading issue with a StackExchange.Redis. It creates a thread underneath, I'm not able to change it... and I found this interesting Uno package.
Will Uno package be able to solve these issues in general, or should I contact the library contributors or the Blazor team? This can happen with other .Net Standard libs, too.
Thank you for your interest @jeromelaban!

@jeromelaban jeromelaban changed the title Add support for netcoreapp3.2 or net5 Add .NET 5 support Oct 19, 2020
@jeromelaban jeromelaban transferred this issue from unoplatform/Uno.Wasm.Bootstrap Oct 19, 2020
@jeromelaban jeromelaban changed the title Add .NET 5 support [Wasm] Add .NET 5 support Oct 19, 2020
@jeromelaban jeromelaban added platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform project/core-tools 🛠️ Categorizes an issue or PR as relevant to core and tools labels Oct 19, 2020
@jeromelaban jeromelaban changed the title [Wasm] Add .NET 5 support [Wasm] Add .NET 5 interpreter support Oct 19, 2020
@jeromelaban
Copy link
Member Author

Fixed by unoplatform/Uno.Wasm.Bootstrap#288

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform project/core-tools 🛠️ Categorizes an issue or PR as relevant to core and tools
Projects
None yet
Development

No branches or pull requests

2 participants