[NetCF 2.0] Problem with generics

  • Thread starter Thread starter Steve B.
  • Start date Start date
S

Steve B.

Hi,

In a class library, I have a static utility class with a methods that
accepts a generic delegate :

public delegate void MyDelegate<T>(
T dataItem,
string mappingName,
) where T : System.Data.DataRow;

And a method that use such a delegate :

public static void MyMethod<T>(
MyDelegate<T> theMethod
) where T : DataRow
{
....
}

When I call MyMethod from a device windows application, it cannot compile
(genasm error).

Is there any way to make it compile ?

Note that if I compile with VS 2005 SP1 Beta, it compile w/o problem.

Thanks,
Steve
 
Steve,

Attempting to use generic delegates a few months ago, I, too, ran into this
issue. I contacted Microsoft and they confirmed that it is fixed in SP1 [note
that this is Visual Studio 2005 SP1 _not_ Compact Frameowrk 2.0 SP1], as you
have observed.

We changed our code to use non-generic delgates... :-/
 
Does the issue concern the compilation of the library or the use of the
library.
In other words, is it possible to compile the library on a separate computer
with the SP1 beta but use this in a VS 2005 RTM project ?

Thanks,
Steve


Nino Benvenuti said:
Steve,

Attempting to use generic delegates a few months ago, I, too, ran into
this
issue. I contacted Microsoft and they confirmed that it is fixed in SP1
[note
that this is Visual Studio 2005 SP1 _not_ Compact Frameowrk 2.0 SP1], as
you
have observed.

We changed our code to use non-generic delgates... :-/

--
Nino Benvenuti
Device Application Development MVP
http://nino.net/blog


Steve B. said:
Hi,

In a class library, I have a static utility class with a methods that
accepts a generic delegate :

public delegate void MyDelegate<T>(
T dataItem,
string mappingName,
) where T : System.Data.DataRow;

And a method that use such a delegate :

public static void MyMethod<T>(
MyDelegate<T> theMethod
) where T : DataRow
{
....
}

When I call MyMethod from a device windows application, it cannot compile
(genasm error).

Is there any way to make it compile ?

Note that if I compile with VS 2005 SP1 Beta, it compile w/o problem.

Thanks,
Steve
 
You should be able to compile it without issue on an VS2005 SP1(beta) box and
then use it on a VS2005 RTM box; however, the IDE still may present issues
when you attempt to use it. I have not fully validated this scenario.

For the project on which I encountered this, the aforementioned procedure
was not an option.

--
Nino Benvenuti
Device Application Development MVP
http://nino.net/blog


Steve B. said:
Does the issue concern the compilation of the library or the use of the
library.
In other words, is it possible to compile the library on a separate computer
with the SP1 beta but use this in a VS 2005 RTM project ?

Thanks,
Steve


Nino Benvenuti said:
Steve,

Attempting to use generic delegates a few months ago, I, too, ran into
this
issue. I contacted Microsoft and they confirmed that it is fixed in SP1
[note
that this is Visual Studio 2005 SP1 _not_ Compact Frameowrk 2.0 SP1], as
you
have observed.

We changed our code to use non-generic delgates... :-/

--
Nino Benvenuti
Device Application Development MVP
http://nino.net/blog


Steve B. said:
Hi,

In a class library, I have a static utility class with a methods that
accepts a generic delegate :

public delegate void MyDelegate<T>(
T dataItem,
string mappingName,
) where T : System.Data.DataRow;

And a method that use such a delegate :

public static void MyMethod<T>(
MyDelegate<T> theMethod
) where T : DataRow
{
....
}

When I call MyMethod from a device windows application, it cannot compile
(genasm error).

Is there any way to make it compile ?

Note that if I compile with VS 2005 SP1 Beta, it compile w/o problem.

Thanks,
Steve
 
Ok thanks,
I'll wait for the SP1 RTM. Workarounds (one method for each type) are enough
to make us work.

Steve


Nino Benvenuti said:
You should be able to compile it without issue on an VS2005 SP1(beta) box
and
then use it on a VS2005 RTM box; however, the IDE still may present issues
when you attempt to use it. I have not fully validated this scenario.

For the project on which I encountered this, the aforementioned procedure
was not an option.

--
Nino Benvenuti
Device Application Development MVP
http://nino.net/blog


Steve B. said:
Does the issue concern the compilation of the library or the use of the
library.
In other words, is it possible to compile the library on a separate
computer
with the SP1 beta but use this in a VS 2005 RTM project ?

Thanks,
Steve


"Nino Benvenuti" <[email protected]> a écrit dans
le
message de news: (e-mail address removed)...
Steve,

Attempting to use generic delegates a few months ago, I, too, ran into
this
issue. I contacted Microsoft and they confirmed that it is fixed in SP1
[note
that this is Visual Studio 2005 SP1 _not_ Compact Frameowrk 2.0 SP1],
as
you
have observed.

We changed our code to use non-generic delgates... :-/

--
Nino Benvenuti
Device Application Development MVP
http://nino.net/blog


:

Hi,

In a class library, I have a static utility class with a methods that
accepts a generic delegate :

public delegate void MyDelegate<T>(
T dataItem,
string mappingName,
) where T : System.Data.DataRow;

And a method that use such a delegate :

public static void MyMethod<T>(
MyDelegate<T> theMethod
) where T : DataRow
{
....
}

When I call MyMethod from a device windows application, it cannot
compile
(genasm error).

Is there any way to make it compile ?

Note that if I compile with VS 2005 SP1 Beta, it compile w/o problem.

Thanks,
Steve
 
Back
Top