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

Calling a C# async method from JavaScript does not wait for result #76

Open
mstrong64 opened this issue Aug 17, 2024 · 0 comments
Open

Comments

@mstrong64
Copy link

To duplicate this issue change an async example in the demo to actually be an async method. e.g.:

public **async Task<object>** GetObjectResponse()
{
    _mainPage.WriteToLog($"I'm a round trip .NET method called from JavaScript getting an object without any input parameters");
    **await Task.Delay(2000);**
    return new List<object>()
    {
        new { Name = "John", Age = 42 },
        new { Name = "Jane", Age = 39 },
        new { Name = "Sam", Age = 13 },
    };
}

The object will not be returned to the JS.

I have a fix if you're interested in a PR, but I guess this issue is being fixed for .net 9?

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