Description
Hey guys,
I got everything running under .Net 4.x and then it turned out for M$ reasons the only way everything was going to work the way I wanted was to upgrade to .Net Core 2.2 so here I am.
This code works perfectly under .Net 4.x but for some reason under .Net Core I can't seem to get it to behave and the exception is giving me literally nothing.
So here's the code ....
var script = "((Core.Objects.Workflow.Activities.DebugActivity)activity).Message = ((Core.Objects.Workflow.Activities.Start<System.Object>)activity.Previous[0]).Data.Message;";
var result = assignContext.Compile<Action<Activity>>(script, "activity");
At runtime I have a collection of Activities that derive from this base type ...
public abstract class Activity
{
public string Ref { get; set; }
public Activity[] Previous { get; set; }
public Activity[] Next { get; set; }
public Action<Activity> AssignValues { get; set; }
....
}
... I have a "Flow" object that contains a collection of activities and a collection of "Links" which contain the expressions that I need to compile.
After constructing each activity as it's concrete type and assigning each of the previous and next arrays shown in the base type above I run the code that's failing in an attempt to build the AssignValues Action for each activity that has link information.
The exception information I'm getting looks like this ...
Message
Value cannot be null.
Stack trace
at System.RuntimeType.MakeGenericType(Type[] instantiation)
at .(ExpressionScope , SyntaxNode , StringBuilder , Int32& , Boolean )
at .(ExpressionScope , SyntaxNode , StringBuilder , Int32& , Boolean )
at .(ExpressionScope , SyntaxNode , Boolean )
at .(ExpressionScope , SyntaxNode , Expression , Boolean )
at .(ExpressionScope , SyntaxNode , Expression , Boolean )
at .(ExpressionScope , SyntaxNode , Expression , Boolean )
at .(ExpressionScope , SyntaxNode , Expression , Boolean )
at .(ExpressionScope , SyntaxNode )
at .(ExpressionScope , SyntaxNode , Expression , Boolean )
at .(ExpressionScope , SyntaxNode , Expression , Boolean )
at .(ExpressionScope , SyntaxNode , Expression , Boolean )
at Z.Expressions.CodeCompiler.CSharp.ExpressionParser.ParseSyntax(ExpressionScope scope, SyntaxNode node, Type resultType)
at .[](EvalContext , String , IDictionary`2 , Type , EvalCompilerParameterKind , Boolean , Boolean )
at Z.Expressions.EvalContext.Compile[TDelegate](String code, String[] parameterNames)
at Workflow.FlowInstance.BuildAssign[T](T activity, Flow flow) in D:\Core Prototype\Everything\Workflow\FlowInstance.cs:line 247
Is there any obvious reason that this would fail as this seems pretty straightforward for the code I have?