I\'m working with the gitpod online IDE ( vs code in the browser with an ubuntu linux server behind it). I\'m struggling with creating a Connection to my mysql database on an ot
From the call stack, it looks like you're compiling your code to wasm using Blazor. This code is running in the browser and is subject to all the limitations of the browser sandbox. More specifically, there is no ability in a browser to open a TCP socket for network communication.
Some more background info is here:
Blazor is running in the browser sandbox and cannot do more than javascript can network wise. So technically this is not possible.
And here:
TCP networking APIs that can't ever work in the browser, since JavaScript doesn't expose raw TCP networking capabilities. This naturally leads to a runtime failure from somewhere low in the stack.
That is why you are getting a PlatformNotSupportedException
.
To fix this, you would need to rearchitect your code so that the MySQL connection is made from code running on a web server, and the Blazor code makes a HTTP request (to a web API) to invoke server-side code that performs the database operation.