WF4 将自托管控制台应用程序托管转换为 IIS 中托管的服务
我有一个控制台应用程序项目,它是使用 WorkflowServiceHost 自托管的工作流服务。它包含流程图工作流定义 (xaml) 和 cs 文件中的一些自定义活动。此应用程序连接(通过服务引用)到托管为 .svc 的 WCF 数据服务。我有一个 aspnet Web 应用程序,它通过服务引用与工作流服务交互。一切正常。
我想将工作流服务控制台应用程序转换为托管在 IIS 上(我正在使用 IIS5 进行开发,实时环境是 IIS6),但我不确定如何进行。我尝试创建一个 WCF WorkflowService 应用程序项目并复制我的 xaml(更改为 xamlx - 不确定我是否需要这样做)和 cs 文件,并创建对我的 WCF 数据服务的服务引用,但是当我尝试浏览xamlx 我收到错误“无法创建未知类型 x” x 是一种应该能够通过其拥有的服务引用“查看”的类型。
我的托管选项有哪些 - 我是否必须使用 WorkflowServiceApplication 还是可以使用 .svc 进行托管?有人可以指出教程或告诉我我需要做什么吗?另外,如果可能的话,我希望将工作流定义放在类库项目中,从而将其与其宿主分开。不过这并不重要。
I have a console application project which is a workflow service self hosted using WorkflowServiceHost. It contains a flowchart workflow definition (xaml) and some custom activities in cs files. This application connects (via a service reference) to a WCF data service hosted as .svc. I have an aspnet web app that interacts with the workflow service via a service ref. It's all working fine.
I'd like to convert the workflow service console app to instead be hosted on IIS (I'm developing using IIS5 and the live environment is IIS6) but am unsure how to go about it. I tried creating a WCF WorkflowService Application project and copying my xaml (changing to xamlx - not sure if I needed to do that or not) and cs files in, and created a service reference to my WCF data service but when I tried to browse the xamlx I got an error "Cannot create unknown type x" x being a type that it should be able to "see" via the service reference it has.
What are my options for hosting - do I have to use WorkflowServiceApplication or can I host using .svc? Can someone point to a tutorial or talk me through what I need to do? Also I would like to have the workflow definition in a class library project if possible, thus separating it from its host. Not critical though.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
XAML 和 XAMLX 文件几乎相同,但又不完全相同。 XAML 文件会生成一个类来包装 XAML,您可以像使用普通类一样使用该类型。 XAMLX 文件不会在运行时编译和解析。两者的根元素也不同,并且 XAMLX 没有 x:Class 属性,因为它未编译。
最简单的方法是仅创建一个 XAMLX 文件并将活动从 XAML 文件复制到 XAMLX 文件中。
A XAML and XAMLX file are almost the same but not quite. The XAML file results in a class being generated to wrap the XAML and you work with that type as if it is a normal class. A XAMLX file is not compiled and parsed at runtime. The root element is also different for the two and the XAMLX has no x:Class attribute because it isn't compiled.
The easiest way is to just create a XAMLX file and copy the activities from the XAML file into the XAMLX file.