Merge pull request #312 from irihitech/browser
Update the latest template of Browser project
This commit is contained in:
commit
ffb1b9c0e8
@ -7,9 +7,9 @@ using Avalonia.Browser;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Web;
|
||||
|
||||
internal partial class Program
|
||||
internal sealed partial class Program
|
||||
{
|
||||
private static async Task Main(string[] args) => await BuildAvaloniaApp()
|
||||
private static Task Main(string[] args) => BuildAvaloniaApp()
|
||||
.StartBrowserAppAsync("out");
|
||||
|
||||
public static AppBuilder BuildAvaloniaApp()
|
||||
|
@ -1,13 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<RuntimeIdentifier>browser-wasm</RuntimeIdentifier>
|
||||
<WasmMainJSPath>AppBundle\main.js</WasmMainJSPath>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0-browser</TargetFramework>
|
||||
<RuntimeIdentifier>browser-wasm</RuntimeIdentifier>
|
||||
<WasmMainJSPath>wwwroot\main.js</WasmMainJSPath>
|
||||
<WasmRuntimeAssetsLocation>./_framework</WasmRuntimeAssetsLocation>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<WasmExtraFilesToDeploy Include="AppBundle\**" />
|
||||
<WasmExtraFilesToDeploy Include="wwwroot\**"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 172 KiB After Width: | Height: | Size: 172 KiB |
@ -7,8 +7,8 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<base href="/" />
|
||||
<link rel="modulepreload" href="./main.js" />
|
||||
<link rel="modulepreload" href="./dotnet.js" />
|
||||
<link rel="modulepreload" href="./avalonia.js" />
|
||||
<link rel="modulepreload" href="./_framework/dotnet.js" />
|
||||
<link rel="modulepreload" href="./_framework/avalonia.js" />
|
||||
<link rel="stylesheet" href="./app.css" />
|
||||
</head>
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { dotnet } from './dotnet.js'
|
||||
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`);
|
||||
@ -10,4 +10,4 @@ const dotnetRuntime = await dotnet
|
||||
|
||||
const config = dotnetRuntime.getConfig();
|
||||
|
||||
await dotnetRuntime.runMainAndExit(config.mainAssemblyName, [window.location.search]);
|
||||
await dotnetRuntime.runMain(config.mainAssemblyName, [window.location.search]);
|
Loading…
x
Reference in New Issue
Block a user