WebView2 #xpa #dotnet


Adrian Wick
 

Hi,

has anyone managed to use https://docs.microsoft.com/sl-si/microsoft-edge/webview2/get-started/winforms with magic?

Regarsd,
A


Craig Martin
 


From: main@magicu-l.groups.io <main@magicu-l.groups.io> on behalf of Adrian Wick <adrian.wick2015@...>
Sent: Tuesday, March 8, 2022 5:22 AM
To: main@magicu-l.groups.io <main@magicu-l.groups.io>
Subject: [magicu-l] WebView2 #xpa #dotnet
 
Hi,

has anyone managed to use https://docs.microsoft.com/sl-si/microsoft-edge/webview2/get-started/winforms with magic?

Regarsd,
A


Jim Stephenson
 

Craig, I am trying to setup that WebView2 demo and when I try to install the cab file I get the following message:

Deployment Image Servicing and Management tool
Version: 10.0.22567.1

Image Version: 10.0.22567.100

An error occurred trying to open - C:\Temp\Webview2.cab Error: 0x80070002

Error: 2

The system cannot find the file specified.

The DISM log file can be found at C:\WINDOWS\Logs\DISM\dism.log



I had renamed it to WebView2.cab because I got the same message when it had its original name and just wanted to see if that made a difference.

Any ideas?


On Tue, Mar 8, 2022 at 9:00 AM Craig Martin <craig@...> wrote:


From: main@magicu-l.groups.io <main@magicu-l.groups.io> on behalf of Adrian Wick <adrian.wick2015@...>
Sent: Tuesday, March 8, 2022 5:22 AM
To: main@magicu-l.groups.io <main@magicu-l.groups.io>
Subject: [magicu-l] WebView2 #xpa #dotnet
 
Hi,

has anyone managed to use https://docs.microsoft.com/sl-si/microsoft-edge/webview2/get-started/winforms with magic?

Regarsd,
A


Adrian Wick
 

Thank you! I'll have a look tomorrow and report back to you!

regards,
A


Craig Martin
 

The first thing I'd suspect would be a corrupt or incomplete download from Microsoft, however the first hit google for that error gave:


Some things to check in there. I haven't encountered that error.


From: main@magicu-l.groups.io <main@magicu-l.groups.io> on behalf of Jim Stephenson <jstephen@...>
Sent: Tuesday, March 8, 2022 10:47 AM
To: main@magicu-l.groups.io <main@magicu-l.groups.io>
Subject: Re: [magicu-l] WebView2 #xpa #dotnet
 
Craig, I am trying to setup that WebView2 demo and when I try to install the cab file I get the following message:

Deployment Image Servicing and Management tool
Version: 10.0.22567.1

Image Version: 10.0.22567.100

An error occurred trying to open - C:\Temp\Webview2.cab Error: 0x80070002

Error: 2

The system cannot find the file specified.

The DISM log file can be found at C:\WINDOWS\Logs\DISM\dism.log



I had renamed it to WebView2.cab because I got the same message when it had its original name and just wanted to see if that made a difference.

Any ideas?

On Tue, Mar 8, 2022 at 9:00 AM Craig Martin <craig@...> wrote:


From: main@magicu-l.groups.io <main@magicu-l.groups.io> on behalf of Adrian Wick <adrian.wick2015@...>
Sent: Tuesday, March 8, 2022 5:22 AM
To: main@magicu-l.groups.io <main@magicu-l.groups.io>
Subject: [magicu-l] WebView2 #xpa #dotnet
 
Hi,

has anyone managed to use https://docs.microsoft.com/sl-si/microsoft-edge/webview2/get-started/winforms with magic?

Regarsd,
A


Craig Martin
 

In some ways, this is a little academic since 4.8 now embeds CEFSharp but WebView2 is far more versatile, robust and better supported. I wouldn't be surprised if MSE swap to this in an upcoming release.
I have no special information on any of their cunning plans, however.


From: main@magicu-l.groups.io <main@magicu-l.groups.io> on behalf of Adrian Wick <adrian.wick2015@...>
Sent: Tuesday, March 8, 2022 10:51 AM
To: main@magicu-l.groups.io <main@magicu-l.groups.io>
Subject: Re: [magicu-l] WebView2 #xpa #dotnet
 
Thank you! I'll have a look tomorrow and report back to you!

regards,
A


Adrian Wick
 

I have downloaded the files and i have the same problem as i did with my application.
The dotnet object placed on the form is shown if i look it in generator. But when i try to run the problem, nothing is shown ... no error or anything.

F8 on the program also gives no error.

Regards
A


Adrian Wick
 

Hm,

how do i install cab file? I must have done something wrong with this ...

regards,
A


Craig Martin
 

Couple of way but easiest is you can right-click and extract the contents.


From: main@magicu-l.groups.io <main@magicu-l.groups.io> on behalf of Adrian Wick <adrian.wick2015@...>
Sent: Thursday, March 10, 2022 10:33 AM
To: main@magicu-l.groups.io <main@magicu-l.groups.io>
Subject: Re: [magicu-l] WebView2 #xpa #dotnet
 
Hm,

how do i install cab file? I must have done something wrong with this ...

regards,
A


Jim Stephenson
 

Craig, where should the contents be extracted to?


On Thu, Mar 10, 2022 at 3:09 PM Craig Martin <craig@...> wrote:
Couple of way but easiest is you can right-click and extract the contents.

From: main@magicu-l.groups.io <main@magicu-l.groups.io> on behalf of Adrian Wick <adrian.wick2015@...>
Sent: Thursday, March 10, 2022 10:33 AM
To: main@magicu-l.groups.io <main@magicu-l.groups.io>
Subject: Re: [magicu-l] WebView2 #xpa #dotnet
 
Hm,

how do i install cab file? I must have done something wrong with this ...

regards,
A


Craig Martin
 

I'll need to revisit my notes, because I used an installer I think you can see from 

They can be anywhere but you'd need to change the CRR to reflect that location.
It's been a few months and the world got busy, I'll verify my steps again soon.


From: main@magicu-l.groups.io <main@magicu-l.groups.io> on behalf of Jim Stephenson <jstephen@...>
Sent: Thursday, March 10, 2022 2:13 PM
To: main@magicu-l.groups.io <main@magicu-l.groups.io>
Subject: Re: [magicu-l] WebView2 #xpa #dotnet
 
Craig, where should the contents be extracted to?

On Thu, Mar 10, 2022 at 3:09 PM Craig Martin <craig@...> wrote:
Couple of way but easiest is you can right-click and extract the contents.

From: main@magicu-l.groups.io <main@magicu-l.groups.io> on behalf of Adrian Wick <adrian.wick2015@...>
Sent: Thursday, March 10, 2022 10:33 AM
To: main@magicu-l.groups.io <main@magicu-l.groups.io>
Subject: Re: [magicu-l] WebView2 #xpa #dotnet
 
Hm,

how do i install cab file? I must have done something wrong with this ...

regards,
A


Adrian Wick
 

Craig thank you for taking the time to help me!

1st i found out that i get 2 different "extractions". I have winrar installed and by default the .cab file was opened with this program.
If i extract using this program, i get this content with directories!


than i did the same with windows explorer:


i get 2 totaly different results ... and not in single one of those two extractions are there files which are in your project CRR:
- Microsoft.Web.dll
- Microsoft.Web.WebView2.Core.dll
- Microsoft.Web.WebView2.WinForms.dll

I found last two on github. But i cant find 1st one Microsoft.Web.dll ...

Regards,
A


Adrian Wick
 

Does anyone know where to get Microsoft.Web.dll?

So here are the steps i did:
1. installed visual studio 2019 (i don't think this was a mandatory step, but i did it anyway)
2. installed edge (the evergreen bootstrap and evergreen stand alone; i also downloaded the fixed version, extracted it into a folder ... i don't know what else to do with the extracted files)
3. installed edge canary (https://www.microsoftedgeinsider.com/en-us/download)
4. downloaded the webview2 from github and nuget ...

and when i run the webview2 xpa sample i still get errors in components sections. so i manually search for dlls ... i find each dll except for the microsoft.web.dll file and when i run the application
i get error that assembly microsoft.web.dll could not be found or loaded ...

regards
A


Adrian Wick
 

Oh boy ... I FINALLY DID IT!

This is all you need guys:





Now I can go have a beer.

Happy holidays everyone!

Regards
A


Avgerinos
 

Hi Adrian & Craig

Still struggling to make it work...
The WebView2 .net control seems to load, but displays only a blank page (without errors).

Which version of .NET framework did you have installed?

Regards
Avgerinos


On 16/4/2022 6:32 μ.μ., Adrian Wick wrote:

Oh boy ... I FINALLY DID IT!

This is all you need guys:





Now I can go have a beer.

Happy holidays everyone!

Regards
A


Roberto Gauer
 

Hi Avgerinos! 

Look for WebView2Loader.dll (x86) and place it on the same folder from others MS libs.

This file comes from nuget package, on runtimes folder.


On Mon, Sep 5, 2022 at 1:41 AM Avgerinos <mento@...> wrote:
Hi Adrian & Craig

Still struggling to make it work...
The WebView2 .net control seems to load, but displays only a blank page (without errors).

Which version of .NET framework did you have installed?

Regards
Avgerinos


On 16/4/2022 6:32 μ.μ., Adrian Wick wrote:
Oh boy ... I FINALLY DID IT!

This is all you need guys:





Now I can go have a beer.

Happy holidays everyone!

Regards
A


Adrian Wick
 

Install the microsoft edge cannary. That did the trick for me.

regards
A


Avgerinos
 

Thanks Roberto and Andrian for the suggestions.

Tried both hints in XPA3.3 & 4.7, but no luck yet.
It always ends up with the following message in mgerror.log: The instance of CoreWebView2 is uninitialized and unable to complete this operation. See EnsureCoreWebView2Async., Program: "TEST__u_IExplorer_.NET_WebView".

It's probably a matter of runtimes & paths setup.
Anyone can describe the exact steps taken to install WebView2 libraries?

Thanks in advance to anyone who can help
Regards
Avgerinos

On 5/9/2022 5:20 μ.μ., Adrian Wick wrote:

Install the microsoft edge cannary. That did the trick for me.

regards
A


Frederik Soete
 
Edited

Hi everybody,

I am indeed late to the WebView2 party. Are there any caveats with regard to deployment? See below Windows 10 versus 11?

Our testing app consists of:
- XPA 3.3k (32-bit)
- A derivative of Craig Martin's code
- Components.xml similar to Adrian Wick's.
- "Microsoft.Web.WebView2.WinForms.dll" can be found in a dedicated app DLL directory.
- "Microsoft.Web.WebView2.Core.dll" can be found in a dedicated app DLL directory.
- "WebView2Loader.dll" (x86) is in the same folder as both these assemblies.

Conclusions:
- On Windows 10 everything is fine: both on the original development workstation, as on another co-worker's workstation. Nothing special has been added, except by Windows itself.
- But on Windows 11, on another co-worker's workstation the same app gives a null reference exception on pressing the GO button.

Can someone offer guidance as to what could be going on? Is something missing from a fresh Windows 11? Other clues?

Thanks in advance,

Frederik Soete


Adrian Wick
 

Hi Frederik,

did you install edge canary (https://www.microsoftedgeinsider.com/en-us/download) on windows 11 where you are running the app for the user logged into the windows?

Regards,
A