-
Notifications
You must be signed in to change notification settings - Fork 1k
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
ActorSystem.Create throws PlatformNotSupportedException on net7.0-android #6459
Comments
Ah, so it's this line that throws? akka.net/src/core/Akka/Actor/Internal/ActorSystemImpl.cs Lines 213 to 214 in 46d680f
That's ancient code - I bet it can be removed safely these days. |
Added a PR to remove it here #6463 |
Thank you for the quick response, I will validate the official fix when the PR is merged (already validated that removing that line fixes the issue on our fork). |
@whoteit92 sounds good - that bit of code was added there probably in 2015, when Mono was the only real game in town to run Akka.NET on POSIX systems. Not needed anymore in the days of .NET Core (and Mono probably fixed that bug at some point.) |
Version Information
1.4.49
Akka.NET
Describe the bug
We have an application that we decided to port to .NET MAUI to have it also be available on Android. When the application is run on Android, the following exception is thrown.
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 _)
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, ActorSystemSetup setup)
To Reproduce
Steps to reproduce the behavior:
Links to working reproductions on Github / Gitlab are very much appreciated
Expected behavior
Either catch the exception thrown by the below line (ActorSystemImpl.cs) or add a compiler directive to not execute it on Android.
typeof(Console).GetProperty("BackgroundColor").GetValue(null); // HACK: Only needed for MONO
Actual behavior
PlatformNotSupportedException
Environment
Works fine on Linux and Windows. Throws on Android. Unable to test on iOS.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: