startit/Emne 3/AvaloniaApplication1/AvaloniaApplication1.Browser/wwwroot/main.js
Geir Okkenhaug Jerstad 9adcac365a Stuff
2024-12-04 11:07:21 +01:00

14 lines
423 B
JavaScript

import { dotnet } from './_framework/dotnet.js'
const is_browser = typeof window != "undefined";
if (!is_browser) throw new Error(`Expected to be running in a browser`);
const dotnetRuntime = await dotnet
.withDiagnosticTracing(false)
.withApplicationArgumentsFromQuery()
.create();
const config = dotnetRuntime.getConfig();
await dotnetRuntime.runMain(config.mainAssemblyName, [globalThis.location.href]);