Asked by:
Adding a type from external assemblies to ToolboxControl

Question
-
I am trying to do something like this:
ToolboxControl ctrl = new ToolboxControl(); Assembly assembly = Assembly.LoadFile(file); var category = new ToolboxCategory(assembly.GetName().Name); foreach (Type t in assembly.GetTypes()) { var wrapper = new ToolboxItemWrapper(t, t.Name); category.Add(wrapper); } ctrl.Categories.Add(category);
i.e. adding ToolboxItemWrappers for each type found in an assembly. However the last line throws the following exception (see image)
http://img41.imageshack.us/img41/2261/7xvqv.png
All dependencies of the external assembly are also referenced in the main (WPF) application. So what's wrong here and how to fix it?
- Edited by Louis Rhys Tuesday, January 4, 2011 3:04 PM
- Moved by Yves.Z Wednesday, January 5, 2011 7:44 AM Workflow related (From:Windows Presentation Foundation (WPF))
All replies
-
-
Hi Louis Rhys,
I move this thread here because of it's likely to get quicker and better responses to WorkFlow develop issues at http://social.msdn.microsoft.com/Forums/en-US/wfprerelease/threads where WorkFlow develop experts live in.
Have a nice day!
Best regards
Yves Zhang [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
-
I would guess it is probably related to using Assembly.LoadFile, see e.g. "
Assembly.Load vs Assembly.LoadFrom vs Assembly.LoadFile".
Tim -