Multiple Generic Type Peramaters (more then 2) problem

Multiple Generic Type Peramaters (more then 2) problem

Old forum URL: forums.lhotka.net/forums/t/3897.aspx


maurera posted on Wednesday, November 14, 2007

While this is not quite a CSLA question, I figured this comunity would be a good resource to ask this question of.

My situation is that I have created a must inherit class [BaseFile] that is defined as having four Generic Types:

Public MustInherit Class BaseFile(Of t_eFields, t_FieldDef As BaseFieldDefinitions.BaseFieldDefinition, t_FieldDefs As BaseFieldDefinitions, t_Record As BaseRecord)

BaseFieldDefinitions and BaseRecord are nested classes in BaseFile, and BaseFieldDefinition is a nested class inside of BaseFieldDefinitions (all of this is so that the entire object hierarchy can "know" about the generic type paramaters in order to construct themselves properly).

The problem I am having is now I can not use databinding from within the same assembly where these classes are defined.  Basicaly, I have a form that exists inside of the same assembly where these classes lives.  I want to be able to bind a list box on this form to an object of T as IFieldDefinitions.  When I attempt to add a data source I get this error right before the list of namespaces is populated:

The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)

In addition, it appears that I can not use the BaseFile class or its nested class as a Databinding source from any assembly (I don't get the error, but they won't appear in the list of selectable classes to create a Data Source for.)  

After doing some research it appears that VS2005 has issues with databinding when a class is define with more then two generic types.  My question is, has anyone else run up against this problem...and if so, any ideas for a solution?

Copyright (c) Marimer LLC