Hello,
I'm writing my first BOI application using C# and I'm having an exception that's getting hit that I don't know what to do about. I'm using the examples provided in the BOI course (specifically example 2) and have imported the DispatchObject into my file. I can create the pvx object just fine and init with the Home directory path, but when I go to invoke the NewObject method on the pvx object to create the SY_Session, I get an exception. Here's my code:
using ( var pvx = new DispatchObject("ProvideX.Script"))
{
pvx.InvokeMethod("Init", @"C:\Sage\Sage 100 ERP Workstation\MAS90\Home");
using ( DispatchObject oSS = new DispatchObject(pvx.InvokeMethod("NewObject", "SY_Session")))
{...}
}
I'm breaking on the second using statement, that creates the session object. The error specifically is: "Exception has been thrown by the target of an invocation."
I confirm that I get the same error even when running the sample code from the BOI class. I'm on Visual Studio 2013 on Windows 7, if that makes a difference. I hope that someone has run into this and can point me in the right direction. Thanks.
jared