TypeLoad Exception when Loading Module

Topics: CAB & Smart Client Software Factory
Nov 3, 2006 at 5:53 AM
originally posted by: DamReev

I've created a library that has the following interface to abstract out a WorkItem:

public interface IWorkItem
ManagedObjectCollection<Command> Commands { get; }
ManagedObjectCollection<object> Items { get; }
WorkItem Parent { get; }
ServiceCollection Services { get; }
ManagedObjectCollection<object> SmartParts { get; }
State State { get;}
WorkItemStatus Status { get; }
WorkItem RootWorkItem { get; }
UIExtensionSiteCollection UIExtensionSites { get;}
ManagedObjectCollection<EventTopic> EventTopics { get;}

I've created a WorkItem in a Module which implements this interface (I don't have to do anything because these properties are already on WorkItem) .
Here is an Example;
public class BankShellWorkItem: WorkItem, IWorkItem{

Note that I've also defined a Presenter with the following generic signature:
public class Presenter<TView,TWorkItem>: IPresenter//,IDisposable
where TWorkItem: IWorkItem
where TView: IView {
//Normal presenter code

//Note that these are concepts I saw in code from this http://msdn.microsoft.com/msdnmag/issues/06/09/SmartClients/ MSDN article

When I try to load the Module containing this WorkItem (using the DependentModuleLoaderService) I get a TypeLoad Exception at runtime, the exception is thrown at line 255 of the DependentModuleLoaderService:

foreach (Type type in assembly.GetExportedTypes()) {

Does anyone have any idea why this is happening?
Nov 8, 2006 at 8:52 AM
originally posted by: DamReev

Never mind, it turns out I had old versions of DLLs that were overwriting the ones seen at compile time.