You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guides/platforms/how-to-use-web-assembly.md
+24-12
Original file line number
Diff line number
Diff line change
@@ -8,12 +8,17 @@ title: Web Assembly
8
8
9
9
Run in the browser with WebAssembly
10
10
11
-
1. Install `wasm-tools` workload tools. See [dotnet documentation](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-workload-install). If you have an older .NET SDK, it might ask you to install other workloads like `wasm-experimental` as well.
11
+
1. Install `wasm-tools` workload tools. See [dotnet documentation](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-workload-install).
12
12
13
13
```bash
14
14
dotnet workload install wasm-tools
15
15
```
16
16
17
+
:::note
18
+
If you are running `net8.0-browser` application on .NET 9 SDK, you should install `wasm-tools-net8` workload instead.
19
+
If you have an older .NET SDK, it might ask you to install other workloads like `wasm-experimental` as well.
20
+
:::
21
+
17
22
2. Install or update the dotnet templates to the latest version.
18
23
19
24
```bash
@@ -41,33 +46,40 @@ cd BrowserTest.Browser
41
46
dotnet run
42
47
43
48
# Output:
44
-
# App url: http://localhost:5000/index.html
45
-
# App url: https://localhost:5001/index.html
49
+
# App url: http://127.0.0.1:53576/
50
+
# App url: https://127.0.0.1:53577/
51
+
# Debug at url: http://127.0.0.1:53576/_framework/debug
52
+
# Debug at url: https://127.0.0.1:53577/_framework/debug
46
53
```
47
54
48
-
49
55
### Deployment
50
56
In the `BrowserTest.Browser` directory, run:
51
57
```bash
52
58
dotnet publish
53
-
54
-
# ... (build output)
55
-
# Generated app bundle at .../bin/Release/net8.0/browser-wasm/AppBundle/
56
59
```
57
-
Now you can serve your app from the `bin/Release/net8.0/browser-wasm/AppBundle` folder (for .NET 8.0, for example) using your favorite web server (such as Azure Static Web Apps).
58
60
59
-
> **Beware:**
61
+
After project was published, .NET SDK creates an app bundle directory with `index.html` file and compiled application files.
62
+
With latest .NET 8 SDK, this directory is located at `bin/Release/net8.0-browser/browser-wasm/publish`.
63
+
Now you can serve your app from this directory using your favorite web server (such as Azure Static Web Apps).
64
+
65
+
:::note
66
+
On older .NET SDK versions, app bundle was located in different directory: `bin/Release/net8.0-browser/browser-wasm/AppBundle` (search for `AppBundle`).
67
+
:::
68
+
69
+
:::warning
60
70
Currently using `dotnet publish` with the `-o` or `--output` flag does not produce the AppBundle folder in the output directory. (See [this issue](https://github.com/dotnet/runtime/issues/94319).) You'll still have to grab it out of the `bin` directory at the path specified by the publish output.
71
+
:::
61
72
62
73
#### Testing AppBundle locally
63
-
You can serve your wasm app from the AppBundle directly using the [dotnet-serve](https://github.com/natemcmaster/dotnet-serve) tool as follows:
74
+
75
+
You can serve your wasm app from this directly using the [dotnet-serve](https://github.com/natemcmaster/dotnet-serve) tool as follows:
0 commit comments