all groups > dotnet compact framework > june 2006 >
You're in the

dotnet compact framework

group:

Generics Problem


Generics Problem Chris Oswald
6/28/2006 7:35:20 AM
dotnet compact framework: I am trying to pass a generic collection as a parameter to a method and
I keep getting a compile error. I can do this in the full framework
but not CF. Can anyone explain to me why this doesn't work? I get the
following error: genasm.exe(1) : error There was an error finalizing
type . Type 'DTC.NAFOP.Mobile.DockClient.Driver,
DTC.NAFOP.Mobile.DockClient, Version=1.0.1.13528, Culture=neutral,
PublicKeyToken=null' was loaded in the ReflectionOnly context but the
AssemblyBuilder was not created as
AssemblyBuilderAccess.ReflectionOnly.

I have attached a code sample below

Public Class Driver()

Sub New()
' Default Ctor
End Sub

private _firstName as string

Public Property FirstName() As String
Get
Return _firstName
End Get
Set(ByVal value As String)
_firstName = value
End Set
End Property

End Class

Public Class Geofence

Sub New()
' Default Ctor
End Sub

Public Sub FenceDrivers(ByVal drivers As
System.Collections.ObjectModel.Collection(Of Driver))
' Fence Drivers
End Sub

End Class
Re: Generics Problem Chris Oswald
6/28/2006 11:50:48 AM
I was missing a namespace import to the system.collections.generic.

[quoted text, click to view]
AddThis Social Bookmark Button