MicrosoftEdge / MicrosoftEdge/WebView2Feedback
Crash when using SetVirtualHostMapping
@LiangTheDev is already working on this.
Since Jul 20, 2023.
- Dominant language
- PowerShell
- Stars
- 526
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
Description
Crash when using SetVirtualHostMapping
Version
SDK: com.microsoft.mixedreality.webview.unity-0.17.1-pre.3.tgz
Runtime: Unity2020.3.33
Framework: Unity2020.3.33, MRTK2.8.3
OS: (Unity Editor) Windows 10 22H2, (Hololens2) 22621.1120.arm64fre.ni_release_svc_sydney_rel_prod.230707-1012
Regression
Was this working before but has regressed? > No.
If yes, what version did this last work on?
Repro Steps
- Clone this repository.
https://github.com/MicrosoftEdge/WebView2Samples/ - Resolve compilation errors
- Do "Restore Features" in Mixed Reality Feature Tool.
- remove this line from package.json
"com.unity.collab-proxy": "2.0.3",
- Open this sample in UnityEditor.
https://github.com/MicrosoftEdge/WebView2Samples/tree/main/GettingStartedGuides/HoloLens2_GettingStarted/HoloLens2GetStartedApp - Attach this script to "WebView"
using Microsoft.MixedReality.WebView;
using System;
using UnityEngine;
public class WebViewExample : MonoBehaviour
{
private void Start()
{
var webViewComponent = gameObject.GetComponent<WebView>();
webViewComponent.GetWebViewWhenReady((IWebView webView) =>
{
((IWithVirtualHost)webView).SetVirtualHostMapping("webview2.sample", "Assets\\Html");
// Navigate to our local content.
// webViewComponent.Load(new Uri("http://webview2.sample/demo.html")); // comment out!!
});
}
}
-
And create a "{ProjectFolder}/Assets/Html/demo.html". (I don't think it matters)
-
When I run it, it crashes. (Both Editor and Hololens.)
Screenshots
Additional context
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.