[英]The type or namespace name 'Confidence' does not exist in the namespace
[英]The type or namespace name 'SqlWorkflowInstanceStore'
我正在使用SqlWorkflowInstanceStore在WF 4.0中構建一些基本的工作流功能。 我添加了正確的參考,並嘗試從客戶端配置文件切換,但是仍然存在相同的問題:
我在Visual Studio 2010的錯誤列表中收到以下錯誤:
錯誤1找不到類型或名稱空間名稱'SqlWorkflowInstanceStore'(您是否缺少using指令或程序集引用?)
我被卡住了,不知道如何解決這個問題。
這是代碼:
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();
}
}
}
使用Workflow持久性時,我在.Net 4中遇到了相同的錯誤,所以我想與大家分享我的發現
The type 'System.Runtime.DurableInstancing.InstanceStore' is defined in an assembly that is not referenced.
我們試圖使用的命名空間是System.Activities.DurableInstancing,但是我們需要引用的程序集實際上是System。 運行時 .DurableInstancing
我知道了:D
希望它能幫助人們
最后! 我知道了
刪除引用並將其重新添加后,錯誤消失了。 我只希望我以前曾經嘗試過。
:)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.