main.js 557 B

12345678910111213141516
  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. const is_browser = typeof window != "undefined";
  5. if (!is_browser) throw new Error(`Expected to be running in a browser`);
  6. const dotnetRuntime = await dotnet
  7. .withDiagnosticTracing(false)
  8. .withApplicationArgumentsFromQuery()
  9. .create();
  10. const config = dotnetRuntime.getConfig();
  11. await dotnetRuntime.runMainAndExit(config.mainAssemblyName, ["dotnet", "is", "great!"]);