[NetCF 2.0] Problem with generics

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
 
G

Guest

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... :-/
 
S

Steve B.

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
 
G

Guest

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
 
S

Steve B.

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top