Structures with enumeration not allowed in assemblies ???


New member
Dec 7, 2006
Programming Experience

I'm just developing an application for mobile devices (Windows CE 5.0) in Visual Studio 2005 (VB.NET) with the .NET Compact Framework 2.0 SP1
and I'm getting big problems by using assemblies (dll).

When I try to instantiate an assembly, which contains a structure with an enumeration inside, I'm getting exceptions.

For example:
In an assembly (A) I've declared a structure, which contains an enumeration:

Public Class CMyClass
Public Structure myStruct
Dim eElementType As eElementType
End Structure

Public Enum eElementType
End Enum
End Class

In my project is a reference on this assembly. Namespaces and imports are correct.

When I instantiate this assembly (A)
Public Class Form1

Dim m_oMyClass As New CMyClass(Me)
CApp.Init(True) 'is in Assembly (B)

End Class
following exception occurs:

"Could not load type 'Test.CApp' from assembly 'xxxxxxxxx, Version=, Culture=neutral, PublicKeyToken=null' geladen werden.

When I remove the line (Dim m_oMyClass As New CMyClass(Me)) everything works fine.

Does anybody have the same problem on structures with enumerations inside?
Top Bottom