Page not rendering using WebView2 although WebView2 RT is installed.

Priyanka Songra 6 Reputation points
2022-05-09T07:31:30.11+00:00

Hi,

We have a VSTO addin for MS Project 2010/2013/2016/2019, where it imports/exports data from an external application and these pages are rendered in embedded Internet Explorer browser from MS Project.
Since IE support will be ending in few years, we are moving to new embedded browser control known as the Microsoft Edge WebView2 control.
I have installed Visual studio 2019, Webview2 runtime (version 101.0.1210.32 ), and our application targets .NET framework version 4.7.2.
On running the published application, although WebView2Loader.dll is present in the runtime folder but still pages are rendered in IE browser only, whereas this works fine when I copy WebView2Loader.dll into the bin folder of our build/release process and then run the application directly from Visual studio , this renders the pages using webview2.

Note: Same published application is rendering pages in webview2 on a different machine which has same version of visual studio, .net framework and webview2 runtime installed.

Anything that I am missing, please let me know. Do we need to package WebView2Loader.dll along with the published application?
Any help on this please.

Thanks,
Priyanka

Microsoft Edge
Microsoft Edge
A Microsoft cross-platform web browser that provides privacy, learning, and accessibility tools.
2,114 questions
Windows for IoT
Windows for IoT
A family of Microsoft operating systems designed for use in Internet of Things (IoT) devices.
381 questions
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,564 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,117 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 55,041 Reputation points
    2022-05-09T17:58:15.273+00:00

    the WebView2Loader.dll is just the wrapper around the actual WebView runtime which is installed separately. The client machine needs to install the runtime (it is part of some Edge installations). see:

    https://learn.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution

    0 comments No comments

  2. Priyanka Songra 6 Reputation points
    2022-05-09T18:03:44.64+00:00

    Hi Bruce @Bruce (SqlWork.com) ,

    I have already installed WebView2 runtime in my machine.

    Thanks,
    Priyanka

    0 comments No comments