Replies: 2 comments 2 replies
-
The reason for the change comes from how VB and C# expressions are done in CoreWF vs .NET Framework. In .NET Framework, VB expressions are handled by a native VB compiler that ships with the .NET Framework. But for C# in .NET Framework, there is no equivalent C# compiler that can be embedded. Instead, the C# expressions are compiled as part of an MSBuild step - hence the existence of the flag RequiresCompilation. In CoreWF, we use Roslyn for both VB and C#. We use the RequiresCompilation flag to trigger the ScriptingAOTCompiler. This creates a single assembly with all the VB/C# expressions in it. Turning off RequiresCompilation means you won't get those expressions. Could you create a small repro of the issue? |
Beta Was this translation helpful? Give feedback.
-
Thanks, @dmetzgar for the response. Here(Workflow.zip) is the simple console application built using .Net48 and .NetCore, to demonstrate the issue. Also, we tried a couple of things, and here are our findings,
The ScriptingAotCompiler is used only when the CompileExression is set to True while loading the activity, Our understanding is, that both AOT and JIT use the same Roslyn compiler for handling expressions. In the case of VisualBasic, while loading activity, if the AOT is not handling the compilation then on performing CacheMetaData, JIT will be used to compile the expression and proceed further. |
Beta Was this translation helpful? Give feedback.
-
To set the context, We are porting our application to .NetCore and currently validating CoreWF, to replace the legacy WF by Microsoft for runtime execution of WorkFlows. So, in our case we need to support the existing InstanceData saved using .Net 4.8 WorflowEngine. When we try to use the old data to resume the workflow in CoreWF, we faced an error(ValidationException) stating there is a mismatch in the Activity.MemberOf.Members list loaded from the existing InstanceData versus the one loaded workflow directly. After debugging we figured out the RequiresCompilation flag is set to true for VisualBasicValue & VisualBasicReference, this led to extra Expressions Activities added to the Members list, which is not the case in .Net4.8. This flag is set to true only for CSharpValue/References in.Net4.8 code base. By flipping the flag and recompiling the dll, we are able to load the existing data without any issue, though we are not sure of any side effects.
Since we are in the final stage of validation, we need to know the reason for this change in flag value, as we need to stick to the actual releases from Nuget instead of recompiling every time with this change.
Here are the screenshots of the Members list in .Net48 and .Net Core, with EnvironmentLocationReference activities are the newly added members for all VisualBasicValue/Reference activity.
Also find the below error message that we get, while loading old data without flipping the RequiresCompilation Flag
Beta Was this translation helpful? Give feedback.
All reactions