Workflow Foundation 3.5에서는 SqlTrackingService를 사용하여 데이터를 추적 할 수 있지만 WF에서는 작동하지 않습니다. 사용하려고하면 SqlTrackingService가 워크 플로 또는 활동 이벤트를 catch하지 않습니다.SqlTrackingService가 WF 4.0에서 작동하지 않는 이유는 무엇입니까?
사용자 지정 추적 서비스를 작성하지 않고 WF 4.0에서 SqlTrackingService를 구성 할 수있는 방법이 있습니까? 그 My3Activity를해야한다주의,
WF3.5은 (완벽하게 작동합니다 : 요점은 내가
여기 두 가지 예합니다 (MS 샘플에서 WorkflowMonitor 같은) 가능한 한 많은 기본 제공 도구를 사용하고자하는 것입니다
namespace WfServiceHost
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Creating workflow runtime...");
using (WorkflowRuntime wr = new WorkflowRuntime())
{
SqlTrackingService ts = new SqlTrackingService("Initial Catalog=Tracking;Data Source=localhost;Integrated Security=SSPI;");
ts.UseDefaultProfile = true;
wr.AddService(ts);
wr.StartRuntime();
Console.WriteLine("Creating workflow instance...");
WorkflowInstance wi = wr.CreateWorkflow(typeof(My3Activity));
Console.WriteLine("Starting workflow instance...");
wi.Start();
Console.WriteLine("Workflow instance started");
Console.WriteLine("Press any key to STOP");
Console.ReadKey();
}
Console.WriteLine("Workflow runtime stopped.");
Console.WriteLine("Press any key to exit...");
Console.ReadKey();
}
}
}
WF4.0 (이벤트를 발생시키지 않습니다 또는 아마 그들은 추적 서비스에 의해 사로 잡았되지 않음) .NET 3.5 워크 플로 활동 라이브러리로 컴파일,이 시간 MyActivity)는 .NET 4.0 WF 활동 도서관입니다
namespace WfServiceHost
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Creating workflow runtime...");
using (WorkflowRuntime wr = new WorkflowRuntime())
{
SqlTrackingService ts = new SqlTrackingService("Initial Catalog=Tracking;Data Source=localhost;Integrated Security=SSPI;");
ts.UseDefaultProfile = true;
wr.AddService(ts);
wr.StartRuntime();
Console.WriteLine("Creating workflow instance...");
MyActivity activity = new MyActivity();
WorkflowApplication app = new WorkflowApplication(activity);
Console.WriteLine("Starting workflow instance...");
app.Run();
Console.WriteLine("Workflow instance started");
Console.WriteLine("Press any key to STOP");
Console.ReadKey();
}
Console.WriteLine("Workflow runtime stopped.");
Console.WriteLine("Press any key to exit...");
Console.ReadKey();
}
}
}