We have installed Microsoft Edge WebView2 runtime(x86) for WebView2. Refer below SS.
We are using .NET Core 3.1 framework and WPF for our App development. Our webview2 runs fine in debug/release/publish mode in Visual Studio but it is not getting loaded once we install our application.
It is not giving any error also when we run app with normal privileges and also not getting loaded. When we run it as "Run as Administrator" it gives below error,
We are using Windows Installer Project extension in Visual studio for .MSI creation
Our XAML code is as below,
<UserControl x:Class="SampleApp.Views.SampleWebView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:wv2="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="10"/>
<ColumnDefinition Width="0.7*"/>
<ColumnDefinition Width="0.3*"/>
<ColumnDefinition Width="10"/>
</Grid.ColumnDefinitions>
<Border Grid.Column="1" Margin="5" CornerRadius="10" BorderThickness="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Border.BitmapEffect>
<DropShadowBitmapEffect Color="Black" Direction="40" ShadowDepth="2" Softness="1" Opacity="0.3" />
</Border.BitmapEffect>
<wv2:WebView2 x:Name="MyWebView" Source="{Binding UrlToGo}" Margin="5 2"/>
</Border>
</Grid>
The UrlToGo is coming from our ViewModel.
Kindly help us to resolve.