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

Windows for business | Windows for IoT
Developer technologies | .NET | .NET Runtime
Developer technologies | VB
Microsoft Edge | Microsoft Edge development
{count} votes

2 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 78,006 Reputation points Volunteer Moderator
    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

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.