我正在使用SqlWorkflowInstanceStore在WF 4.0中構建一些基本工作流功能。 我已經加入了正確的引用,並試圖從客戶端配置文件切換,但仍是同樣的問題:類型或名稱空間名稱'SqlWorkflowInstanceStore'
我得到的錯誤列表下面的錯誤在Visual Studio 2010中:
錯誤1類型或命名空間名稱SqlWorkflowInstanceStore'找不到(您是否缺少使用指令或程序集引用?)
我被卡住了,不知道如何解決此問題。
下面的代碼:
using System;
using System.Linq;
using System.Activities;
using System.Activities.Statements;
using System.Activities.DurableInstancing;
using System.Runtime.DurableInstancing;
using System.Threading;
namespace mybasicwf4
{
class Program
{
static void Main(string[] args)
{
string sqlPersistenceDBConnectionString = @"Data Source=.;Initial Catalog=PersistenceDatabase;Integrated Security=True";
SqlWorkflowInstanceStore sqlWFInstanceStore = new SqlWorkflowInstanceStore(sqlPersistenceDBConnectionString);
AutoResetEvent waitHandler = new AutoResetEvent(false);
WorkflowApplication wfApp = new WorkflowApplication(new Workflow1());
wfApp.InstanceStore = sqlWFInstanceStore;
wfApp.Unloaded = (arg) =>
{
waitHandler.Set();
};
wfApp.PersistableIdle = (arg) =>
{
return PersistableIdleAction.Unload;
};
wfApp.Run();
waitHandler.WaitOne();
}
}
}