WF4.5 not compiling side-by-side c# workflows

前端 未结 1 1768
生来不讨喜
生来不讨喜 2021-01-15 08:03

I have an IIS hosted xamlx workflow with c# expressions that I\'m trying to run in side-by-side versioning.

I did exactly like this article: Side by side versioning

相关标签:
1条回答
  • 2021-01-15 09:02

    After analyzing the source code from .Net, I realized that the method CreateWorkflowServiceHost that I override in my custom workflow factory, adds all supported versions in it's return object.

    All I had to do is iterate this collection and compile them all.

    Final source code:

        protected override WorkflowServiceHost CreateWorkflowServiceHost(WorkflowService service, Uri[] baseAddresses)
        {
            var host = base.CreateWorkflowServiceHost(service, baseAddresses);
    
            // add your customizations here…
            CompileExpressions(service.Body);
            foreach (var supportedVersion in host.SupportedVersions)
            {
                CompileExpressions(supportedVersion.Body);
            }
    
            return host;
        }        
    
    0 讨论(0)
提交回复
热议问题