You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
internalstaticclassProgram{staticvoidMain(string[]args){varv1=newVariable<int>();varhelloWorldActivity=newSequence(){Variables={v1},Activities={newWriteLine{Text=newCSharpValue<string>("\"aaaa\" + \"sadas\"")}}};CompileWorkflow(helloWorldActivity);varwfApp=newWorkflowApplication(helloWorldActivity);wfApp.Run();Console.ReadLine();}privatestaticvoidCompileWorkflow(Activityactivity){varactivityName=activity.GetType().ToString();varactivityType=activityName.Split('.').Last()+"_CompiledExpressionRoot";varactivityNamespace=string.Join(".",activityName.Split('.').Reverse().Skip(1).Reverse());varsettings=newTextExpressionCompilerSettings{Activity=activity,Language="C#",ActivityName=activityType,ActivityNamespace=activityNamespace,RootNamespace=null,GenerateAsPartialClass=false,AlwaysGenerateSource=true,ForImplementation=false,};TextExpressionCompilerResultsresults=newTextExpressionCompiler(settings).Compile();// Any compilation errors are contained in the CompilerMessages.if(results.HasErrors)thrownewException("Compilation failed.");// Create an instance of the new compiled expression type.varcompiledExpressionRoot=Activator.CreateInstance(results.ResultType,newobject[]{activity})asICompiledExpressionRoot;CompiledExpressionInvoker.SetCompiledExpressionRoot(activity,compiledExpressionRoot);}}
The result of running:
The text was updated successfully, but these errors were encountered:
Here is sample code:
The result of running:
The text was updated successfully, but these errors were encountered: