# WebView2ControlMBS Runtime Exception

**URL:** <https://forum.xojo.com/t/webview2controlmbs-runtime-exception/64535>\
**Category:** Plugins\
**Created:** [July 16, 2021, 6:57pm UTC](https://forum.xojo.com/t/webview2controlmbs-runtime-exception/64535 "2021-07-16T18:57:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Goecken](https://forum.xojo.com/letter_avatar_proxy/v4/letter/j/ad7895/32.png) [@John\_Goecken](https://forum.xojo.com/u/John_Goecken)\
**Post date:** [July 16, 2021, 6:57pm UTC](https://forum.xojo.com/t/webview2controlmbs-runtime-exception/64535/1 "2021-07-16T18:57:55Z")

</div>

I have a windows app that has 2 WebView2ControlMBS controls (web1, web2). web1 has a webpage loaded but I’m not doing anything with it. web2 loads a site, grabs the source, parses the data and prints something. This all works fine except for after printing I immediately load a different page in web2 ([www.google.com](http://www.google.com)) and it throws a runtime error. I don’t think it has anything to do with web1. It doesn’t like loading that website after it parses the data, how can I stop the runtime error? It is all in a method, I’m wondering if the original page I load is still running something in the background while I try and load the new page. I tried web2.stop and that didn’t seem to help either.

---

<div class="post-metadata">

**Author:** ![Christian\_Schmitz](https://forum.xojo.com/user_avatar/forum.xojo.com/christian_schmitz/32/158_2.png) [@Christian\_Schmitz](https://forum.xojo.com/u/Christian_Schmitz)\
**Post date:** [July 16, 2021, 7:09pm UTC](https://forum.xojo.com/t/webview2controlmbs-runtime-exception/64535/2 "2021-07-16T19:09:56Z")

</div>

Details?  
What exception and what message text?

---

<div class="post-metadata">

**Author:** ![John\_Goecken](https://forum.xojo.com/letter_avatar_proxy/v4/letter/j/ad7895/32.png) [@John\_Goecken](https://forum.xojo.com/u/John_Goecken)\
**Post date:** [July 16, 2021, 7:37pm UTC](https://forum.xojo.com/t/webview2controlmbs-runtime-exception/64535/3 "2021-07-16T19:37:09Z")

</div>

It’s a RuntimeException, ErrorNumber -2137024809, The parameter is incorrect.

---

<div class="post-metadata">

**Author:** ![Christian\_Schmitz](https://forum.xojo.com/user_avatar/forum.xojo.com/christian_schmitz/32/158_2.png) [@Christian\_Schmitz](https://forum.xojo.com/u/Christian_Schmitz)\
**Post date:** [July 16, 2021, 8:04pm UTC](https://forum.xojo.com/t/webview2controlmbs-runtime-exception/64535/4 "2021-07-16T20:04:48Z")

</div>

And call stack for that exception?

---

<div class="post-metadata">

**Author:** ![John\_Goecken](https://forum.xojo.com/letter_avatar_proxy/v4/letter/j/ad7895/32.png) [@John\_Goecken](https://forum.xojo.com/u/John_Goecken)\
**Post date:** [July 16, 2021, 8:11pm UTC](https://forum.xojo.com/t/webview2controlmbs-runtime-exception/64535/5 "2021-07-16T20:11:23Z")

</div>

I’m reading that there iis only a certain amount of times a method can call itself. I’m assume my method is just constantly looping and causing the runtime exception. Either way I was able to load a blank page about:blank instead of Google. I guess the blank page is stopping my method from looping. I haven’t got time to look into it more but thank you for the quick replies.

---

<div class="post-metadata">

**Author:** ![Christian\_Schmitz](https://forum.xojo.com/user_avatar/forum.xojo.com/christian_schmitz/32/158_2.png) [@Christian\_Schmitz](https://forum.xojo.com/u/Christian_Schmitz)\
**Post date:** [July 16, 2021, 9:02pm UTC](https://forum.xojo.com/t/webview2controlmbs-runtime-exception/64535/6 "2021-07-16T21:02:12Z")

</div>

Yes, recursion is limited.

e.g. if you have an event which fires, when a page loads, and there you load a new page, you may cause an endless loop.

---

<div class="post-metadata">

**Author:** ![John\_Goecken](https://forum.xojo.com/letter_avatar_proxy/v4/letter/j/ad7895/32.png) [@John\_Goecken](https://forum.xojo.com/u/John_Goecken)\
**Post date:** [July 16, 2021, 9:14pm UTC](https://forum.xojo.com/t/webview2controlmbs-runtime-exception/64535/7 "2021-07-16T21:14:04Z")

</div>

That sounds exactly like what I did. Thanks for the help.
