compact framework error

Posts   
 
    
jspanocsi
User
Posts: 145
Joined: 04-Mar-2005
# Posted on: 28-Jul-2006 03:26:30   

I upgraded to the latest version to fix a timeout problem earlier today. It worked fine until I generated again. Now I get an error out of each entity that's marked as serializable


Error   1 'SerializableAttribute' is an ambiguous reference between System.SerializableAttribute' and 'SD.LLBLGen.Pro.ORMSupportClasses.SerializableAttribute'  
C:\mobile\NeoPocketDiary20\NeoPocketDiaryBackend\DatabaseGeneric\HelperClasses\ResultsetFields.cs   
24 3 NeoPocketDiaryBackend

Looks like there was a dummy attribute created because the compact framework didn't have one. I think MS added one. The other thing that changed is that I installed sp1 for the 20 compact framework.

Any ideas? I should be able to just change the templates to qualify the attribute and it work right? Thanks!

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 28-Jul-2006 07:47:36   

I think you'd better modify the templates to fully qualify the attribute to be "System.SerializableAttribute".

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 28-Jul-2006 08:55:32   

I'll do some testing today with SP1 for CF20. As unittesting on the CF framework is not possible, tests aren't done automatically. There's indeed a dummy attribute created to make porting the code easier. If SP1 for CF20 adds one, it's really unfortunate... rage But I'll check it out simple_smile

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 28-Jul-2006 10:43:45   

This sucks bigtime...

It's not there in CF.NET 2.0, they have added it to SP1:

Added the Serializable attribute.

how silly is this... remoting isn't supported on the CF... Oh well..

What makes this so bad is that the dummy class is in the runtime libs. Removing it from there, it will require users to use CF.NET 2.0 SP1. Keeping it there will make CF.NET 2.0 SP1 users not be able to use the generated code. I can't change the template headers to [System.Serializable], because that will skip the dummy class for CF.NET 2.0 users without SP1.

One way to 'solve' this is to make the dummy class I have internal, and add a dummy class to the generated code, which is then enabled by using a conditional compilation directive, but that too is complicated, people will use the wrong templates, wrong dlls, don't know how to add the conditional compilation directive to the compiler options etc. disappointed

If anyone has ideas, please let me know, I don't see an easy way to solve this without breaking code and I hate that. This compactframework turns out to be an even bigger nightmare than mysql support... disappointed

Frans Bouma | Lead developer LLBLGen Pro
jspanocsi
User
Posts: 145
Joined: 04-Mar-2005
# Posted on: 28-Jul-2006 14:17:45   

Sorry for the bad news confused

I get all the weird bugs...

Why don't you leave everything as it is now and just fully qualify the template code that's generated to use yours and forget the MS one? That way it doesn't matter if its sp1 or not. It would always use yours. The error stems from the fact it can't figure out which one to use since it's not qualified.

jspanocsi
User
Posts: 145
Joined: 04-Mar-2005
# Posted on: 28-Jul-2006 14:19:02   

as a side note, you already have the CF compiler directive. You could put the template [serialize] in a compiler directive. If it's CF then use yours fully qualified, if not CF use ms's.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 28-Jul-2006 16:46:04   

jspanocsi wrote:

Sorry for the bad news confused

I get all the weird bugs...

Why don't you leave everything as it is now and just fully qualify the template code that's generated to use yours and forget the MS one? That way it doesn't matter if its sp1 or not. It would always use yours. The error stems from the fact it can't figure out which one to use since it's not qualified.

That would require me to alter every template there is. simple_smile Now the templates used for CF.NET are also used for normal .NET code.

But indeed, I think the wrapping of the serializable attribute in #if CF tags is better. The MS one doesn't do anything anyway, just serve the same purpose as my dummy one.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 03-Aug-2006 18:14:59   

Fix is now available.

Frans Bouma | Lead developer LLBLGen Pro