서비스로 호스팅되는 간단한 워크 플로우가 있습니다. 난 그냥이 워크 플로우에서 예외를 처리하는 것이 좋습니다.Windows 워크 플로 서비스 - 사용자 지정 서비스 호스트. 워크 플로우 이벤트 처리
내 워크 플로가 '문자열'을 매개 변수로 가져 와서 int로 변환하려고합니다. 그래서 'asasafs'와 같은 데이터를 보낼 때마다 실패하고 예외가 throw됩니다. 난 비주얼 스튜디오 2K10을 사용하고
public class MyServiceHostFactory : System.ServiceModel.Activities.Activation.WorkflowServiceHostFactory
{
protected override WorkflowServiceHost CreateWorkflowServiceHost(Activity activity, Uri[] baseAddresses)
{
return base.CreateWorkflowServiceHost(activity, baseAddresses);
}
protected override WorkflowServiceHost CreateWorkflowServiceHost(WorkflowService service, Uri[] baseAddresses)
{
var host = base.CreateWorkflowServiceHost(service, baseAddresses);
WorkflowRuntimeBehavior wrb = host.Description.Behaviors.Find<WorkflowRuntimeBehavior>();
if (wrb == null)
wrb = new WorkflowRuntimeBehavior();
wrb.WorkflowRuntime.ServicesExceptionNotHandled += WorkflowRuntime_ServicesExceptionNotHandled;
wrb.WorkflowRuntime.Started += WorkflowRuntime_Started;
wrb.WorkflowRuntime.WorkflowCompleted += WorkflowRuntime_WorkflowCompleted;
host.Description.Behaviors.RemoveAll<WorkflowRuntimeBehavior>();
host.Description.Behaviors.Add(wrb);
host.Faulted += host_Faulted;
host.UnknownMessageReceived += host_UnknownMessageReceived;
return host;
}
void workflowRuntime_WorkflowCreated(object sender, WorkflowEventArgs e)
{
throw new NotImplementedException();
}
void WorkflowRuntime_WorkflowCompleted(object sender, System.Workflow.Runtime.WorkflowCompletedEventArgs e)
{
throw new NotImplementedException();
}
void WorkflowRuntime_Started(object sender, System.Workflow.Runtime.WorkflowRuntimeEventArgs e)
{
throw new NotImplementedException();
}
void WorkflowRuntime_ServicesExceptionNotHandled(object sender, System.Workflow.Runtime.ServicesExceptionNotHandledEventArgs e)
{
throw new NotImplementedException();
}
void host_UnknownMessageReceived(object sender, System.ServiceModel.UnknownMessageReceivedEventArgs e)
{
throw new NotImplementedException();
}
void host_Faulted(object sender, EventArgs e)
{
throw new NotImplementedException();
}
}
: 아주 간단한 나는 내 자신의 WorkflowServiceHostFactory을 만들 수 있지만 unfortunatelly 내 간단한 작업을 수행 할 수 읽었습니다
이 내 구현 :
입니다 및 iisexpress, 워크 플로가 예외를 throw 할 때마다 디버거가 내 이벤트 핸들러에서 중단되지 않습니다. 올바르게 수행하는 방법을 알고 있습니까?