The sample shows how to build a small WebXR sample on .Net wasm. It does not render anything, just reads the device position, orientation and projection matrix.
The source code of the webxr native library is not published yet, but it will be soon.
- (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/webxr.sln solution or VSCode/Terminal.
dotnet build -c [Debug|Release]
From VS2022 you can run the profile Wasm.WebXR.Sample
. Additionally you can publish the app
dotnet publish -c [Debug|Release]
and run the app by populating the folder src\webxr\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.
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.