简体   繁体   English

重新托管的工作流设计器在加载时引发TypeLoadException

[英]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. 有一个IDocFieldDocField<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.

相关问题 在工作流托管的Designer中加载StateMachine元素 - Loading StateMachine Elements in Workflow Rehosted Designer 在重新托管的工作流设计器中编辑FlowDecision的DisplayName属性 - Edit the DisplayName property of a FlowDecision in Rehosted Workflow Designer 如何将右键单击断点菜单添加到重新托管的工作流设计器 - How to add the right-click breakpoints menu to a rehosted workflow designer 从重新托管的设计器中打印.NET WF4工作流程 - Print .NET WF4 workflow from rehosted designer 如何在(重新托管的)工作流设计器中将工作流与旧版本的活动库一起使用? - How can I use workflows with older versions of activity libraries in (rehosted) workflow designer? InnerException 引发 TypeLoadException TypeLoadException:无法从程序集“System.ServiceModel”加载类型“System.UriTemplate”, - InnerException throws TypeLoadException TypeLoadException: Could not load type 'System.UriTemplate' from assembly 'System.ServiceModel, 自定义NativeActivity以在重新托管的设计器上显示参数 - Custom NativeActivity to show Arguments on a rehosted designer NDjango抛出TypeLoadException - NDjango throws TypeLoadException Pechkin lib 抛出 TypeLoadException - Pechkin lib throws a TypeLoadException XAML设计器System.TypeLoadException - XAML designer System.TypeLoadException
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM