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

BeginInvoke - PlatformNotSupportedException on NET 5 #6

Open
BrianBergh opened this issue Mar 4, 2021 · 0 comments
Open

BeginInvoke - PlatformNotSupportedException on NET 5 #6

BrianBergh opened this issue Mar 4, 2021 · 0 comments

Comments

@BrianBergh
Copy link

Hi.
Im using MonoGame.Extended2 in my Memory3D Engine.

I reacently ported the original .NET Framework codebase to .NET 5 (Monogame 3.8 Core)

This gives an error when the video reaches the end, as of this line
(apx line 540)
Ended?.BeginInvoke(this, EventArgs.Empty, null, null);
in MonoGame.Extended.VideoPlayback\DecodeContext.cs

is not suppored in NET 5.

I have found a workaround my self, and it seems to do the trick (everything works perfect in NET 5 now)
Use Task.Run instead, works like a charm!

        // Must use BeginInvoke. See the explanations of Ended.
        // Ended?.BeginInvoke(this, EventArgs.Empty, null, null);
        Task.Run(() => // .NET 5 compatible as BeginInvoke is not supported
        {
          Ended?.Invoke(this, EventArgs.Empty);
        });

However, i have no clue on how to contribute to this repo :(
If i could, i would do it.

Anyway, there is the solution - fully tested in NET 5, works perfect :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant