Add-on components that enhance and customize the Visual Studio integrated development environment
I got it working. there was some permission issue that i didn't digg into , but configuring webview2 with UserDataFolder solved it and now the WebView2 component works.
<wv2:WebView2
Name="webView2"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<wv2:WebView2.CreationProperties>
<wv2:CoreWebView2CreationProperties UserDataFolder="C:\temp\myFolder"/>
</wv2:WebView2.CreationProperties>
<wv2:WebView2.Source>https://bing.com</wv2:WebView2.Source>
</wv2:WebView2>
Now I'm struggling how to get a reference to the WebView2 instance. I want to add listeners and I want to be able to send js messages to the web view.
in a VSSDK extension I added the WebView2 control as above to a tool window control xaml , and in the xaml.cs file i had a reference to it.
but in a VisualStudio.Extensibility extension it works differently, there is a RemoteUserControl.
So i need a way to get the reference to WebView2 , or a way to register the listeners in the xaml and bind them to some commands or something like that. maybe you have an idea?