Skip to content

Commit f24cdcf

Browse files
authored
Merge branch 'main' into main
2 parents 7c9569e + ca034db commit f24cdcf

File tree

1 file changed

+24
-12
lines changed

1 file changed

+24
-12
lines changed

docs/guides/platforms/how-to-use-web-assembly.md

+24-12
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,17 @@ title: Web Assembly
88

99
Run in the browser with WebAssembly
1010

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).
1212

1313
```bash
1414
dotnet workload install wasm-tools
1515
```
1616

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+
1722
2. Install or update the dotnet templates to the latest version.
1823

1924
```bash
@@ -41,33 +46,40 @@ cd BrowserTest.Browser
4146
dotnet run
4247

4348
# 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
4653
```
4754

48-
4955
### Deployment
5056
In the `BrowserTest.Browser` directory, run:
5157
```bash
5258
dotnet publish
53-
54-
# ... (build output)
55-
# Generated app bundle at .../bin/Release/net8.0/browser-wasm/AppBundle/
5659
```
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).
5860

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
6070
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+
:::
6172

6273
#### 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:
6476
```bash
6577
dotnet tool install --global dotnet-serve
6678

67-
dotnet serve -d:bin/Release/net8.0/browser-wasm/AppBundle
79+
dotnet serve -d:bin/Release/net8.0-browser/browser-wasm/publish
6880

6981
# Output:
70-
# Starting server, serving bin/Release/net8.0/browser-wasm/AppBundle
82+
# Starting server, serving bin/Release/net8.0-browser/browser-wasm/publish
7183
# Listening on any IP:
7284
# http://localhost:49875
7385
```

0 commit comments

Comments
 (0)