I have a very simple app at this time. I am developing in VB.NET (CLR 4.5) and using the VBScript Engine. My application is to be used for industrial process simulations so my .Net application will call the same script method (Sub Main) roughly every second.
The code in VB.Net looks like this.
Public Sub Main()
x = 5
Right now I am just using a button to test this. The first time I click the button, I Execute the entire script
On subsequent button pushes I call Main
And I get the following error
"Exception has been thrown by the target of an invocation."
I have found that the following works fine however I read a post here that recommends against invoking script this way for performance reasons. Because my application will likely call many different Sub Main() scripts every second, performance will be very
I have stripped this down as much as possible and still can't get it to work as recommended - any suggestions?