question

PriyankaSongra-6960 avatar image
0 Votes"
PriyankaSongra-6960 asked YuZhou-MSFT commented

Page not rendering using WebView2 although WebView2 RT is installed.

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

dotnet-visual-basicms-edgedotnet-runtimewindows-embedded
· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @PriyankaSongra-6960

Which kind of WebView2 Runtime are you using? You can refer to this doc to confirm again if a suitable WebView2 Runtime is already installed.
Do you have all the files to ship with the app?
Besides, what are the versions for the working one and not working one MS project and OS?

0 Votes 0 ·

Hi @YuZhou-MSFT

I am using evergreen standalone installer kind of WebView2 RT. I have verified the registry keys too and its all good.
Yes, I do have all the files to ship with the app and this issue I am facing even when I am trying to run my application from Visual studio 2019.
MS Project version is same in both working and not working machines and it is MS Project 2013.
For working one, OS is windows 10 (32 bit) and for non working one it is windows 10 (64 bit).

Thanks,
Priyanka

0 Votes 0 ·
YuZhou-MSFT avatar image YuZhou-MSFT PriyankaSongra-6960 ·

Hi @PriyankaSongra-6960

You can try to install any Microsoft Edge Insider (preview) Channel and test again. And do you install the WebView2 SDK?
You say it doesn't work even running from VS2019, is there any error showing when you run the code? If there is, the error occurs on which line of code?
If possible, you can provide a minimal code snippet which can reproduce the issue so that we can have a test.

0 Votes 0 ·
Show more comments
Bruce-SqlWork avatar image
0 Votes"
Bruce-SqlWork answered

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://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

PriyankaSongra-6960 avatar image
0 Votes"
PriyankaSongra-6960 answered

Hi Bruce @Bruce-SqlWork ,

I have already installed WebView2 runtime in my machine.

Thanks,
Priyanka

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.