[英]Rehosted Workflow Designer throws TypeLoadException upon Load
I'm trying to rehost the workflow designer in my WPF app. 我正在尝试在WPF应用程序中重新托管工作流设计器。
However, when I try to initialise it I get a TypeLoadException
dialog with the following message: 但是,当我尝试对其进行初始化时,将显示
TypeLoadException
对话框,并显示以下消息:
"Could not load type 'Reporting.Primitives.Documents.IDocField`1' from assembly 'Reporting.Primitives, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'."
“无法从程序集'Reporting.Primitives,版本= 1.0.0.0,区域性=中性,PublicKeyToken =空'中加载类型'Reporting.Primitives.Documents.IDocField'1'。”
I've tried stripping it down and have gotten to the simple invocation code here: 我尝试将其剥离,并在此处获得了简单的调用代码:
var wnd = new Window();
var grid = new Grid();
wnd.Content = grid;
var met = new DesignerMetadata();
met.Register();
var d = new WorkflowDesigner();
d.Load(new Sequence());
grid.Children.Add(d.View);
wnd.Show();
It is the call to Load
that causes the exception. 是对
Load
的调用导致异常。
Here's the weird part: There's no type in the solution called IDocField<T>
. 这是奇怪的部分:解决方案中没有类型
IDocField<T>
。
There's an IDocField
and a DocField<T> : IDocField
, so it seems to be inventing this IDocField<T>
type from somewhere. 有一个
IDocField
和DocField<T> : IDocField
,因此它似乎是从某个地方发明了此IDocField<T>
类型。
I don't have any reflection calls looking for an IDocField<T>
either. 我也没有寻找
IDocField<T>
任何反射调用。
I've also tried moving this code around the app into various modules that aren't directly referencing Reporting.Primitives
to no avail. 我还尝试将这段代码在应用程序中移动到不直接引用
Reporting.Primitives
各种模块中。
There is an IUiDocField<T>
interface floating around. 周围有一个
IUiDocField<T>
接口。
Curiously enough, I did write an interface IDocField<T>
some time ago, but it's not in the solution now, so I don't see why it would be causing problems. 奇怪的是,我前一段时间确实写了一个接口
IDocField<T>
,但是现在不在解决方案中,所以我不明白为什么它会引起问题。
As usual It's always your (my) fault. 像往常一样, 这总是你(我)的错。
The app pulls in plugins via a directory using reflection, and it appears there was an old dll in there that was referencing the IDocField<T>
interface. 该应用程序使用反射通过目录插入插件,并且似乎其中存在引用
IDocField<T>
接口的旧dll。
It would seem that this wasn't a problem until the workflow designer attempted to probe the assembly for type information that something finally noticed it was referencing something that wasn't there! 直到工作流设计人员尝试在程序集中查找类型信息(似乎终于注意到它引用了不存在的内容),这似乎才不是问题!
facepalm 面容
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.