Webview2 not working

Ajay Mutalikdesai 1 Reputation point
2020-12-24T13:00:13.993+00:00

Hi,

We had a project setup on 2.0 .net framework. We changed it to 4.7.2 to use webview2. When we try to initialize corewebview2 we get error as in screenshot. When we create new .net framework project and initialize corewebview2 it works fine. We have a desktop application which COM app which tries to open this form and we get the error as below.

Error when desktop app (COM app) tries to open the form(Note: the project for this form was initially set to 2.0 and now 4.7.2.)51078-image.png:

51079-image.png

The above is setting in our visual studio.

When we create a .net framework project and try to initialize it works fine. We are not opening this form from desktop app:

51114-image.png

Developer technologies Windows Forms
{count} votes

2 answers

Sort by: Most helpful
  1. Ajay Mutalikdesai 1 Reputation point
    2020-12-28T06:59:29.903+00:00

    Kyle,

    COM app is iManage Document Management System app. To change the framework right clicked on project -> Properties -> Application->Target Framework (4.7.2).

    To reproduce:

    1) Create .net framework windows form app in visual studio with webview2.
    2) Add a class file tp project and create object of above form.
    3) In constructor of the form write code to initialize CoreWebView2.

    Please refer below code:

    51537-image.png

    We also have this checked in our project:

    51561-image.png


  2. Ajay Mutalikdesai 1 Reputation point
    2020-12-29T08:15:38.753+00:00

    Kyle,

    51981-image.png

    Gave full access to this path and it works.

    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.