-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VSTO Excel Addin TaskPane VB.Net CoreWebView2 Will Not Populate #622
Comments
@TF523 Is it causing any error/exception? Also I'm not sure if it was just a copy error in your post, but you need to pass ENV to EnsureCoreWebView2Async(ENV). Do you have a runtime installed (Edge Canary/Dev/Beta, or WebView2 Runtime)? |
yes it was just a copy error from my last iteration. I was trying different combinations and that was left over. As far as the exception Initially when I tried to set the source it was giving me a write permission error just like they experienced on the other thread. When I moved to EnsureCoreWebView2Async that error went away and now the exception is object not assigned because it is nothing. |
Thanks for following up so quickly... |
Yes I have Dev version of runtime installed |
I set up a sample project to quickly test it in a vb.net form and everything works fine... But in our TaskPane version, when I step through the code the the assignment never happens in EnsureCoreWebView2Async. It remains nothing... |
Do you have a repro app I could try out? Another thing to try is to use the WebView2.CoreWebView2Ready event and see if that ever gets hit. |
Unfortunately I cannot provide access to the repo it is part of a much larger proprietary project. I dont see how the event is going to get triggered the object is nothing. I am sure our setup is good because it worked fine on the sample forms project. When it comes to the VSTO task pane I am not sure what else to try... It was hard to tell from the #187 thread, I couldn't really tell what finally got the WPF version to work for them. |
Understandable. Are you doing anything with threading, or is this all happening on your main UI thread? Or are you doing anything else besides just creating the WebView2? I agree it looks like you are doing the right things here. I'll open a bug on our backlog and we'll try to repro and see what's going wrong. |
No threading all on the Main UI. Called in an Async sub. Not sure what you mean by "are we doing anything else besides just creating the webview"? The task pane houses many controls and the WebView is located on a tabbed page control container. As far as the exceptions our build is clean at this point this is the only problem. All I have done with the webview is placed it on the pane and now I am just trying to get it to work, no other navigation other than just a test call to bing... |
Nic-
Can u send me what the default properties are for the core object. Default execfolderpath and any other properties that may not be available, maybe we can set those... i was thinking that maybe due to a path reference issue the object wont instantiate...
Thank you again for the help...
Let me know...-tyler
Sent from Yahoo Mail on Android
|
Thanks for the added context around how the control is being used. The default when no exec folder is given is that the WebView2Loader.dll includes logic to see what versions of the runtime (Edge Canary/Dev/Beta or WebView2 Runtime) may be installed on the machine. It will find and use the most stable of those available. You have Dev installed, so it should be able to find and use that for any shipped version of our Nuget SDK package. Some other things to double-check from #187:
|
I am not using the source anywhere...
The .dll is in the deployment debug folder...
Sent from Yahoo Mail on Android
|
Nic-
Have u attempted a simple vb.net vsto addin with this control placed on a taskpane??? Does it work 4 u???
Sent from Yahoo Mail on Android
|
No sorry I haven't had time to try this out myself. In general I don't have time to manually repro the issues people are running into, so I try to help as much as I can through debugging or asking for a reproducing app I can run on my machine. We have a bug on our backlog that would include one of our devs trying to reproduce this issue, but our backlog is large and I'm not sure when a dev will be able to try it out. |
I will repo a simple build this afternoon for u to look at...
Sent from Yahoo Mail on Android
|
Nic-
I have made a sample project for you. I have verified that the problem is solely with the core object and nothing to do with our code. To further investigate I have made both a TaskPane and a Form version of the WebView2 control that reside within the same Excel VSTO AddIn. What I have discovered is the Form version works fine, the TaskPane seems to be where the issue resides. On the Form the display and navigation are flawless, on the TaskPane it immediately dies and gets a null object reference exception (just like what is happening on our larger project). Please try the sample code to verify... please ignore my quick sloppy programming I am in a huge hurry trying to get this put together for you.
TF523/Excel_AddIn_WebView2
This is a sample project that houses a Form and a TaskPane for the WebView2 control to reside. For debugging of WebView2.
Thank you again for your help...
-Tyler
|
Nic-
Verifying that the target user directory is working just fine when used with the form from within the vsto add-in.
![Capture](https://user-images.githubusercontent.com/5530663/98882539-5efc4f80-2441-11eb-8709-7d2fc2fbc283.PNG)
|
For your bug file. The task pane WebView2 exception...
![Capture](https://user-images.githubusercontent.com/5530663/98882435-1349a600-2441-11eb-9263-237758d0e3fb.PNG)
|
@TF523 Thanks for putting together a sample, much appreciated! I'm not seeing it though - is there a link or attachment missing? (I'm using github.com - looks like you may be using email which could have dropped an attachement?) |
Here is the exception thrown in debugger in case email broke the link again... https://user-images.githubusercontent.com/5530663/98882435-1349a600-2441-11eb-9263-237758d0e3fb.PNG |
Was able to repro and figured out the issue. Apparently we have a check for "DesignMode" that looks for whether or not we have a "Site", which is set on controls in the VisualStudio Designer. However, we assume that the presence of a "Site" means we are in designer, when in fact there are other circumstances that a Site is set - like the Task Pane. We are tracking a fix for this as part of #614, and will hopefully be available in the next release. |
@champnic do u know when is the next update supposed to be released? |
Probably around the end of this month. |
@champnic Is there any access to the control.site property in runtime to override it as a workaround for now, or are we dead in the water until the update??? |
Nic- |
@champnic this may or may not be an issue, but I was setting up selenium to some automation testing on our embedded viewer (based on this article: https://docs.microsoft.com/en-us/microsoft-edge/webview2/howto/webdriver). Anyway I am having a tough time getting it to work as part of an add-in. Also this article is a little dated as the selenium EdgeOptions constuctor has been updated as of their a-07 update. I am probably just goobing the path executables for some reason as the add-in fires from a different location, but I was wondering if you know of anyone making this work in C# or vb.net as an add-in. Thank you... |
Glad it's working now! I'm going to close this issue out, but if you see the same problem let me know. Re: Selenium - We have an existing bug to update our docs - I just pinged the owner to see if we can update it sooner. Unfortunately I don't think I've seen or heard of anyone using selenium with add-ins yet. |
@TF523 , re:
Which SDK and runtime bits are you using? |
64 bit os visual studio .net 4.8 |
Thanks. |
The latest pre-release webview2 from nuget. And latest edge developer release...
Sent from Yahoo Mail on Android
On Wed, Dec 2, 2020 at 6:51 AM, ShaunLoganOracle<notifications@github.com> wrote:
Thanks.
More specifically, which WebView2 SDK and WebView2 Runtime (or non-stable Microsoft Edge (Chromium) Canary channel ) are you using?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
For others encountering this thread, in case it might help. Env: |
This issue doesn't seem to be resolved from #187. I am using vb.net to attempt to place WebView2 control into an excel vsto addin task pane and I am having no luck. I have used the EnsureCoreWebView2Async to attempt to get the core object to populate and there is simply nothing that will work. Converting the following lines to vb:
C#
var env = await CoreWebView2Environment.CreateAsync (null, "C:\temp");
await webView21.EnsureCoreWebView2Async (env);
webView21.CoreWebView2.Navigate ("https://bing.com")
VB.NET
Dim env as object
env = Await CoreWebView2Environment.CreateAsync(Nothing, "C:\Test")
Await WebView21.EnsureCoreWebView2Async(env)
WebView21.CoreWebView2.navigate("https://www.bing.com")
Still the core object will not assign.
I have attempted every conceivable combination which included using the CoreWebView2CreationProperties to set the path prior to the core object assignment, and still nothing has worked.
I am working off the Microsoft.Web.WebView2.1.0.674-prerelease.
I thought that it may be the browserexcutablefolder causing it to fail, but that doesn't seem to work when I tried set that either. I am at a loss...
AB#30216412
The text was updated successfully, but these errors were encountered: