WF4托管将自托管控制台应用程序转换为IIS中托管的服务 [英] WF4 hosting conversion of self hosting console app to service hosted in IIS

查看:151
本文介绍了WF4托管将自托管控制台应用程序转换为IIS中托管的服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个控制台应用程序项目,它是一个使用WorkflowServiceHost自托管的工作流服务。它包含流程图工作流定义(xaml)和cs文件中的一些自定义活动。此应用程序(通过服务引用)连接到以.svc托管的WCF数据服务。我有一个aspnet Web应用程序,它通过服务引用与工作流服务交互。一切正常。

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.

我想将工作流服务控制台应用程序转换为IIS上托管(我正在使用IIS5进行开发,实时环境是IIS6 )但我不确定如何去做。我尝试创建一个WCF WorkflowService应用程序项目并复制我的xaml(更改为xamlx - 不确定我是否需要这样做)和cs文件,并创建了对我的WCF数据服务的服务引用但是当我尝试浏览时xamlx我收到错误无法创建未知类型xx是一种类型,它应该能够通过它具有的服务引用看到。

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.

我的是什么托管选项 - 我是否必须使用WorkflowServiceApplication或者我可以使用.svc托管?有人可以指点教程或者告诉我我需要做什么吗?另外,我希望在可能的情况下在类库项目中使用工作流定义,从而将其与主机分离。但并不重要。

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.

推荐答案

XAML和XAMLX文件几乎相同但不完全相同。 XAML文件导致生成一个类来包装XAML,并且您使用该类型就像它是普通类一样。不会在运行时编译和解析XAMLX文件。两个根元素也不同,XAMLX没有x:Class属性,因为它没有编译。

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.

最简单的方法是创建一个XAMLX文件并将活动从XAML文件复制到XAMLX文件中。

The easiest way is to just create a XAMLX file and copy the activities from the XAML file into the XAMLX file.

这篇关于WF4托管将自托管控制台应用程序转换为IIS中托管的服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆