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

Creation of AblyRealtime client in Blazor apps results in PlatformNotSupportedException #1152

Open
marcduiker opened this issue Jun 1, 2022 · 4 comments
Labels
enhancement New feature or improved functionality.

Comments

@marcduiker
Copy link

marcduiker commented Jun 1, 2022

Expected behavior

The AblyRealtime instance is created without issues.

Actual behavior

When the AblyRealtime instance is created the following exception is thrown:

System.AggregateException: One or more errors occurred. (The type initializer for 'IO.Ably.Encryption.Crypto' threw an exception.)
 ---> System.TypeInitializationException: The type initializer for 'IO.Ably.Encryption.Crypto' threw an exception.
 ---> System.PlatformNotSupportedException: System.Security.Cryptography.Csp is not supported on this platform.
   at System.Security.Cryptography.RNGCryptoServiceProvider..ctor()
   at IO.Ably.Encryption.Crypto..cctor()
   --- End of inner exception stack trace ---
   at IO.Ably.ChannelOptions..ctor(ILogger logger, Boolean encrypted, CipherParams params, ChannelModes modes, ChannelParams channelParams)
   at IO.Ably.ChannelOptions..ctor(Boolean encrypted, CipherParams params, ChannelModes modes, ChannelParams channelParams)
   at IO.Ably.ClientOptions..ctor()
   at Program.<Main>$(String[] args) in C:\dev\ably-labs\serverless-websockets-quest\ServerlessWebsocketsQuest.Client\Program.cs:line 11
   --- End of inner exception stack trace ---

Impact

It seems like Ably can't be used at all in Blazor apps at the moment. WebAssembly is getting quite some traction these days so it would be great if Ably can be used with it.

Cause

This seems to be causing the exception: System.Security.Cryptography APIs not supported on Blazor WebAssembly

Repo to reproduce

https://github.com/ably-labs/serverless-websockets-quest
Use the switch-to-blazor branch.

┆Issue is synchronized with this Jira Research by Unito

@tomkirbygreen
Copy link
Contributor

I think we need to treat WebAssembly as a new platform that we build for, and test on. Looping in @AndyNicks to get a product perspective on this.

@AndyNicks
Copy link

This research on WebAssembly is put on the roadmap.

@tomkirbygreen tomkirbygreen removed their assignment Aug 2, 2022
@MarianoGomezBidondo
Copy link

Any news about it?

@QuintinWillison QuintinWillison added enhancement New feature or improved functionality. and removed question labels Dec 6, 2022
@mikelee638
Copy link

Hey @MarianoGomezBidondo, unfortunately no, there is no new news on this. We will let you know if there are updates, thanks for your interest!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improved functionality.
Development

No branches or pull requests

6 participants