I was having some issues the other day with my interface lagging and after asking here someone suggested using a using statement to dispose of the webbrowser.
Now after implementing it I keep getting:
NullReferenceException was unhandled by user code- Object reference not set to an instance of an object.
I am having a weird issue because even if I am running code that has nothing to do with another I keep getting the nullreference error there which makes no sense.
Here is an example of my code:
using (System.Windows.Forms.WebBrowser webBrowser1 =
new System.Windows.Forms.WebBrowser())
{
// issue happens here
if (webBrowser1.Url.AbsoluteUri.Contains("/signup"))
{
// rest of the code
}
}