Call Automation from C#.. Stuck with error: Exception thrown: 'System.NullReferenceException' in OpenSpan.Runtime.Core.dll Object reference not set to an instance of an object.
I've been trying to experiment with calling an automation from C#, but am experiencing an nullReference error on creating new instance of the automation reference.. I used two articles to base my code on (https://pdn.pega.com/example-using-studio-adapters-c-project & https://pdn.pega.com/documents/creating-csharp-studio-project-references) Both suggest I can easily make the call, but I get a failure on the cca = new CcallingActivity.Project.CcallingActivity(); line of code. I've included all the pega references I could find, and the project compiles without error. Must be missing something.. But figure out what/where to look? this is Pega Robotics v8.0 with .net 4.6.1
The code I'm using is below:
public static CcallingActivity.Project.CcallingActivity cca;
public static CcallingActivity.simpleAdd sa;
static void Main(string args)
cca = new CcallingActivity.Project.CcallingActivity();
catch (Exception err)
The exception being thrown may be indicating that your code is trying to access an object that either doesn't exist yet, or has already been destroyed. You may need to manipulate the build order so that everything for OpenSpan is already configured and ready to go before you start calling your own code.