The sample shows how to publish a wasm app on production with file compression.
- (Optional - Recommended) Visual Studio 2022
- (Required without VS2022) Download latest dotnet nightly SDK release.
- Install wasm-tools (root terminal):
dotnet workload install wasm-tools --skip-manifest-update
Use VS2022 src/filesystem-server.sln solution to build tasks project, then build the server project. You can also use VSCode/Terminal:
dotnet build src\filesystem.tasks\Wasm.FileSystem.Tasks.csproj
dotnet build -c [Debug|Release] src\filesystem\Wasm.FileSystem.Server.csproj
From VS2022 you can run the profile Wasm.FileSystem.Server
. Additionally you can publish the app
dotnet publish -c [Debug|Release] src\filesystem\Wasm.FileSystem.Sample.csproj
and run the app by populating the folder src\filesystem\bin[Debug|Release]\net6.0\publish\wwwroot.
In this second case we do recommend to use VSCode Live Server, instead of Fenix, as the second has known issues with Web Assembly.
From VS2022 you can publish the Server project to an Azure Web App. You will need to publish it as a self-contained app, because .Net6 rc2 is not supported for now. Alternatively you can publish the app using VSCode/Terminal:
dotnet publish -c Release -r win-x86 --self-contained src\filesystem.server\Wasm.FileSystem.Server.csproj
Debug is in an experimental phase and currently some workarounds are needed to make it work.
- Install Visual Studio 2022.
- Install latest rc2 sdk.
- Go to
C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.MonoTargets.Sdk
and copy the folder6.0.0-rc2.X.X/tasks/net472
to6.0.0-rtm.X/tasks/net472
- Finally clean and rebuild the projects from VS2022. After that you will be able to put a break point and debug your Wasm .Net6 app.