Tested with .Net SDK version 9.0.200, RestSharp v112.1.0.
- Open this repo in devcontainer, e.g. using Github Codespaces. Type or copy/paste following commands to devcontainer's terminal.
cdinto the folder of this example:
cd browser-and-node-RestSharp/browser- Create new .Net project using
wasmbrowsertemplate:
dotnet new wasmbrowser- Install RestSharp library as dependency:
dotnet add package RestSharp- Replace generated HelloWorld-like
Program.csandwwwrootcontents with HTTP-enabled ones:
cp ../Program.cs ./
cp ../index.html ./wwwroot/
cp ../main.js ./wwwroot/- Compile the example:
dotnet build- Generate bunch of self-signed development SSL certificates:
dotnet dev-certs https- Run debug HTTP server to temporarily publish project to Web:
dotnet runCodespace will show you "Open in Browser" button. Just click that button or obtain web address from "Forwarded Ports" tab.
-
As
index.htmland about 23MB of js and wasm files are loaded into browser, refer to browser developer console to see the results. -
If you want to publish this on your own server, you can run bundling by:
dotnet publish -c ReleasePerform your own experiments if desired.