I posted this in azure and asp.net forum a few minutes ago because I did not know there is a Blazor forum. I think this question might be more appropriate for this forum:
Attempting to use Microsoft.Azure.ServiceBus.TopicClient from a Blazor Wasm app seems to produce "Operation is not supported on this platform." However, I am not convinced as the debugging tools, modules, etc are now all 100% working either.
Environment:
VS 2019 16.6.2
Microsoft.Azure.ServiceBus 4.1.3.0
Using new version of Edge (which was the only way I could get debugging to work from VS)
Is this supposed to work, or is the scenario not yet supported?
No. You will need to call a web server to make the call. You should be able to call service bus rest api (I believe it supports CORS now)
more detail.
A WASM application can not make a network call. It must interop to the JavaScript engine for this. A WASM app runs in a pretty tight sandbox, no I/o, no threads. To run blazor there is a small .net runtime written in C/C++ (there is a pollyfill for web assembly
written in JavaScript for those browsers that don’t support web assembly). Very few O/S features are in the runtime as every one must be implemented by JavaScript interop, and of course are limited to what JavaScript can do in the browser.
Blazor programs are not compiled to web assembly. They are standard .net dlls, that the blazor runtime executes.
the blazor httpclient is one written for the blazor runtime that calls to JavaScript to make the actual call. As it’s using the JavaScript api, it must follow the CORS rules.
I expected that may be the case. Thank you for the reply, saves us a lot of time trying to get something to work that fundamentally is not a solution. We'll take a look at the REST API and some other options.
Member
1 Points
2 Posts
Should service bus TopicClient work from Blazor Wasm?
Jun 18, 2020 08:03 PM|Shamus Fuller|LINK
I posted this in azure and asp.net forum a few minutes ago because I did not know there is a Blazor forum. I think this question might be more appropriate for this forum:
Attempting to use Microsoft.Azure.ServiceBus.TopicClient from a Blazor Wasm app seems to produce "Operation is not supported on this platform." However, I am not convinced as the debugging tools, modules, etc are now all 100% working either.
Environment:
Is this supposed to work, or is the scenario not yet supported?
Thank you,
Shamus Fuller
All-Star
58224 Points
15671 Posts
Re: Should service bus TopicClient work from Blazor Wasm?
Jun 19, 2020 01:18 AM|bruce (sqlwork.com)|LINK
No. You will need to call a web server to make the call. You should be able to call service bus rest api (I believe it supports CORS now)
more detail.
A WASM application can not make a network call. It must interop to the JavaScript engine for this. A WASM app runs in a pretty tight sandbox, no I/o, no threads. To run blazor there is a small .net runtime written in C/C++ (there is a pollyfill for web assembly written in JavaScript for those browsers that don’t support web assembly). Very few O/S features are in the runtime as every one must be implemented by JavaScript interop, and of course are limited to what JavaScript can do in the browser.
Blazor programs are not compiled to web assembly. They are standard .net dlls, that the blazor runtime executes.
the blazor httpclient is one written for the blazor runtime that calls to JavaScript to make the actual call. As it’s using the JavaScript api, it must follow the CORS rules.
Member
1 Points
2 Posts
Re: Should service bus TopicClient work from Blazor Wasm?
Jun 19, 2020 01:27 PM|Shamus Fuller|LINK
I expected that may be the case. Thank you for the reply, saves us a lot of time trying to get something to work that fundamentally is not a solution. We'll take a look at the REST API and some other options.
Thank you again