Home > Mobile >  What is the best way to release WebView2 (in order to use Google Maps) without Evergreen runtime?
What is the best way to release WebView2 (in order to use Google Maps) without Evergreen runtime?

Time:10-06

We have to introduce the WebView2 in order to use Google Maps into our WinForms project and we cannot have the Evergreen Runtime installed on all the numerous PCs.
Currently our compile weighs 25Mb.
If we add the NuGet libraries of WebView2 and the FixedVersionRuntime, the compile becomes over 500Mb (20 times bigger).

Our questions:

1 - Is it compulsory to release the entire FixedVersionRuntime on every single pc? (I'm afraid I understand yes, but I'm a dreamer...)

2 - At runtime when the WebView2 control is instantiated, a "[ProjectName]WebView2" folder is also created within the executable directory. From our first tests we have observed that this folder tends to get bigger. Does anyone know if this folder is managed automatically by the runtime or if you have to worry about cleaning it up?

3 - On MSDN it is instructed to use the "WebView2LoaderPreference" property to distribute WebView2 as a single file:
https://learn.microsoft.com/en-us/microsoft-edge/webview2/how-to/static?source=recommendations
It is not clear to us if the meaning of this property is what we would like, that is to have a single WebView2 library to release (hoping it will take up less space...). In any case it is not clear how it works: inserting the property apparently does not change anything in the compiled files.

Thanks in advance for any advice.

CodePudding user response:

Ultimately the best option remains to install the EvergreenRuntimeVersion online, so as to release only the 1.5Mb installer. This component is also already present in Windows 11, so it will tend to become more and more comfortable to use as customers adopt Windows 11.

Alternatively the only option is to release the entire FixedRuntimeVersion which occupies more than 370Mb.

  • Related