-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
34 lines (29 loc) · 1.05 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Text;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Senstate.NetStandard;
using Senstate.CSharp_Client;
namespace blazor_wasm
{
public class Program
{
public static async Task Main(string[] args)
{
var webSocket = new NetStandardWebSocketImplementation();
webSocket.ExceptionThrown += (sender, e) => // Optional if you want to catch Connection issues
{
throw e.Exception;
};
SenstateContext.SerializerInstance = new NetStandardJsonNetImplementation();
SenstateContext.WebSocketInstance = webSocket;
SenstateContext.RegisterApp("C# Blazor WASM");
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("app");
builder.Services.AddBaseAddressHttpClient();
await builder.Build().RunAsync();
}
}
}