【发布时间】:2011-08-22 23:18:52
【问题描述】:
我正在开发 WF,我正在制作书签。 当我写以下内容时,我可以很好地放弃这个活动:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Activities;
using System.Activities.Validation;
using Microsoft.VisualBasic.Activities;
using System.Windows;
using System.Data;
using System.Linq;
using SimpleWebDesigner.ServiceReference1;
namespace SimpleWebDesigner.Bookmark_exmple
{
class newBookmark: NativeActivity
{
Service1Client ser = new Service1Client();
[RequiredArgument]
public OutArgument<bool> Out_arg { get; set; }//=new OutArgument<string>(output);// { get; set; }
protected override void Execute(NativeActivityContext context)
{
context.CreateBookmark("samename", new BookmarkCallback(OnBookmarkCallback));
}
protected override bool CanInduceIdle
{
get
{
return true;
}
}
void OnBookmarkCallback(NativeActivityContext context, Bookmark bookmark, object val)
{
bool approve;
approve = (bool)ser.get_from_WF(1);
Out_arg.Set(context, approve);
}
}
}
赞这个页面https://skydrive.live.com/?cid=F1FD3CCD21D87C68&id=F1FD3CCD21D87C68%21351&sc=documents
但是当我通过 WCF 从 DB 读写时,代码如下:
class newBookmark: NativeActivity
{
Service1Client ser = new Service1Client();
[RequiredArgument]
public OutArgument<bool> Out_arg { get; set; }//=new OutArgument<string>(output);// { get; set; }
void OnBookmarkCallback(NativeActivityContext context, Bookmark bookmark, object val)
{
bool approve;
string exp;
approve = (bool)ser.get_from_WF(1);
if (approve == true)
exp = "momo";
else
exp = "yoyo";
Out_arg.Set(context, exp);
}
当我想删除此活动时,它没有,并显示一个弹出窗口并显示以下错误:调用的目标已引发异常
有什么帮助吗? 谢谢。
【问题讨论】:
-
请发布您的异常的堆栈跟踪。我们无法猜测它来自哪条线路。
-
它不在运行时,当我将它拖放到 XMAL 文件中时,在我运行项目之前。
标签: wcf workflow-foundation-4 bookmarks