Skip to content

Latest commit

 

History

History
37 lines (22 loc) · 1.53 KB

README.md

File metadata and controls

37 lines (22 loc) · 1.53 KB

WebXR wasm sample

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.

Prerequisites

  • (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

Build

Use VS2022 src/webxr.sln solution or VSCode/Terminal.

dotnet build -c [Debug|Release]

Run

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

Debug is in an experimental phase and currently some workarounds are needed to make it work.

  1. Install Visual Studio 2022.
  2. Install latest rc2 sdk.
  3. Go to C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.MonoTargets.Sdk and copy the folder 6.0.0-rc2.X.X/tasks/net472 to 6.0.0-rtm.X/tasks/net472
  4. 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.