Skip to content

Akka.Actor: does not run inside Blazor WASM #5082

Open
@Aaronontheweb

Description

@Aaronontheweb

Version Information
Version of Akka.NET? v1.4.20
Which Akka.NET Modules? Akka

Describe the bug
At the moment it is not possible to start an ActorSystem inside a WASM Blazor application due to a number of platform compatibility / unsupported methods Akka.NET calls during startup.

To Reproduce

  1. Create Blazor WASM application;
  2. Call ActorSystem.Create

See petabridge/DrawTogether.NET#10 for a code sample

Expected behavior
Akka.NET should be able to start up correctly.

Actual behavior

blazor.webassembly.js:1 crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
      Unhandled exception rendering component: Exception has been thrown by the target of an invocation.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.PlatformNotSupportedException: Operation is not supported on this platform.
   at System.ConsolePal.get_BackgroundColor()
   at System.Console.get_BackgroundColor()
   at System.Reflection.RuntimePropertyInfo.StaticGetterAdapterFrame[ConsoleColor](StaticGetter`1 getter, Object obj)
   at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index)
   --- End of inner exception stack trace ---
   at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index)
   at System.Reflection.PropertyInfo.GetValue(Object obj)
   at Akka.Actor.Internal.ActorSystemImpl.Start()
   at Akka.Actor.ActorSystem.CreateAndStartSystem(String name, Config withFallback, ActorSystemSetup setup)
   at Akka.Actor.ActorSystem.Create(String name, Config config)
   at DrawTogether.UI.Client.Program.<>c.<Main>b__0_0(IServiceProvider sp) in D:\Repositories\DrawTogether.NET\src\DrawTogether.UI\Client\Program.cs:line 26

Screenshots
You can see me try to run it here https://www.twitch.tv/videos/1050466404

Environment
Windows, .NET 5, Chromium Browser

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions