Microsoft.Toolkit.Win32 icon indicating copy to clipboard operation
Microsoft.Toolkit.Win32 copied to clipboard

WebView: blank page on some machines

Open Myrmex opened this issue 5 years ago • 1 comments

I'm submitting a...

  • Bug report (I searched for similar issues and did not find one)

Current behavior

The WebView works fine in my development machines, but in most client machines just shows a blank page.

Expected behavior

The WebView should show the intended page, or at least throw some error.

Minimal reproduction of the problem with instructions

To reproduce the issue, I created a WPF app which just shows the Google search page on load, as follows (Visual Studio 2019 Preview 4):

  1. create a new .NET Core WPF app.
  2. add the WPF WebView package. The resulting csproj is thus:
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
  <PropertyGroup>
    <OutputType>WinExe</OutputType>
    <TargetFramework>netcoreapp3.0</TargetFramework>
    <UseWPF>true</UseWPF>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.Toolkit.Wpf.UI.Controls.WebView" Version="6.0.0-preview7.1" />
  </ItemGroup>
</Project>
  1. add the WebView control to the MainWindow page:
<Window x:Class="WebViewRepro.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WebViewRepro"
        xmlns:toolkit="clr-namespace:Microsoft.Toolkit.Wpf.UI.Controls;assembly=Microsoft.Toolkit.Wpf.UI.Controls.WebView"
        mc:Ignorable="d"
        Loaded="Window_Loaded"
        Title="MainWindow" Height="450" Width="800">
    <Grid>
        <toolkit:WebView Name="_web" AllowDrop="False"/>
    </Grid>
</Window>
  1. in the Window_Loaded code-behind event handler, just load a page from the internet:
private void Window_Loaded(object sender, RoutedEventArgs e)
{
    _web.Navigate("https://www.google.com");
}

To test this outside my development machines, I run a Windows Sandbox instance, publish the repro app, copy the published files to it, and run. The app starts with no apparent error, but the page shown is blank. My Sandbox OS is as follows:

Windows 10 Enterprise
Version 1903
OS build 18362.356

Environment

Nuget Package(s): 

- Microsoft.Toolkit.Wpf.UI.Controls.WebView

Package Version(s): 

- 6.0.0-preview7.1

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] Insider Build (build number: )

App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] Insider Build (xxxxx)

Device form factor:
- [x] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [ ] 2017 (version: )
- [x ] 2019 Preview (version: 4)

Myrmex avatar Sep 20 '19 07:09 Myrmex

Same over here

  • Package Version: 6.0.0 Stable
  • VS2019 16.4
  • W10 19.09 18363.535 -.Net 4.6.2

Cannot Navigate to any page. It has worked once, and then never again. (Even with a new project or WebView samples..)

keytrap-x86 avatar Dec 16 '19 11:12 keytrap-x86