Matthieu Charbonnier
Matthieu Charbonnier

Reputation: 2982

WPF (or WinForm) WebView doesn't opens local URL (NotFound 404 error)

Introduction

Microsoft recently released the WebView control (Microsoft.Toolkit.Win32.UI.Controls package), that allows developer to include a Webbrowser which uses Microsoft Edge to render website in WPF/WinForm application. This new control is intended to replace the old WebBrowser control which is using IE engine.

More info here

My problem

The browser doesn't seems to work with local network website urls. Even if I use ip address, I always get the NotFound (404) on my WebErrorStatus (but no exception), but in the stand-alone Edge browser it works well. However, external urls (google...) are working fine.

I've tried to check if the embeded browser uses proper proxy settings, but i've got no luck.

Upvotes: 2

Views: 1044

Answers (1)

Matthieu Charbonnier
Matthieu Charbonnier

Reputation: 2982

For security purpose, the WebView control disables private network capabilities by default. You must enable it explicitly.

wvc.IsPrivateNetworkClientServerCapabilityEnabled = true;

Upvotes: 2

Related Questions