main.js 659 B

12345678910111213141516171819
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT license.
  3. import { dotnet } from './dotnet.js'
  4. import { registerAvaloniaModule } from './avalonia.js';
  5. const is_browser = typeof window != "undefined";
  6. if (!is_browser) throw new Error(`Expected to be running in a browser`);
  7. const dotnetRuntime = await dotnet
  8. .withDiagnosticTracing(false)
  9. .withApplicationArgumentsFromQuery()
  10. .create();
  11. await registerAvaloniaModule(dotnetRuntime);
  12. const config = dotnetRuntime.getConfig();
  13. await dotnetRuntime.runMainAndExit(config.mainAssemblyName, ["dotnet", "is", "great!"]);