Compiling erros when upgrading from 2.6 to 3.5

Posts   
 
    
bsargos
User
Posts: 6
Joined: 16-Nov-2012
# Posted on: 13-Feb-2013 18:11:21   

Hi all,

We are currently working on a big project (more than 300 tables), using LLBLGen 2.6. We must upgrade to 3.5. So, I passed the first steps, generating the llblgen.proj. Not so hard... But the real problem is coming : using the new LLBLGen designer, I get many and many compiling errors, because of methods passed from public to protected. All our files contain custom code, so I had to let them in the destination folder, letting LLBLGen engine just changing the generated code. But this didn't happen. Instead of that, old generated code was still here, giving me the errors, like SetRelatedEntity and others, like already mentioned here :

http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=19751&StartAtMessage=25&HighLight=1

I confirm that generating the files in a new folder is better, giving much fewer errors. But so, what about the custom code ? Indded, our problem is that we have many custom code embedded in the generated files. Can you please tell me if we missed anything ?

Thank you very much for your help.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 13-Feb-2013 19:47:33   

When you say custom code embedded in the generated files, do you mean code in partial class files? or the code was written in custom code regions inside generated files?

bsargos
User
Posts: 6
Joined: 16-Nov-2012
# Posted on: 14-Feb-2013 10:54:24   

Hi Walaa, thanks for your interest. I'm talking about code embedded in custom code regions inside generated files.

Thanks.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 14-Feb-2013 18:33:39   

That won't work, as now you are using old generated files with newly generated ones, which won't work.

Please try to extract these into separate files (partial classes), and pay attention to the Breaking changes in the docs.

bsargos
User
Posts: 6
Joined: 16-Nov-2012
# Posted on: 15-Feb-2013 09:28:34   

Thnaks Walaa. I dreaded your reply. Using partial classes would be a good choice, but the problem is that we have written our custom code in several places in the generated files, like constructor or InitialMembers method and others. Maybe a very bad practice... This is becoming very tricky.

Any idea is welcome. Thank you.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 15-Feb-2013 11:02:54   

I'm afraid there is nothing else you can do.

bsargos
User
Posts: 6
Joined: 16-Nov-2012
# Posted on: 15-Feb-2013 16:09:40   

Mmmmh, bad news. Thanks.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39910
Joined: 17-Aug-2003
# Posted on: 16-Feb-2013 11:17:48   

Erm... I've to reopen this thread, because generating code on top of old generated code should work, it should pick up the user code generations and migrate them.

If you make a copy of the v2.6 code, generate with 3.5 on top of that, it should work and generate v3.5 code and migrate the user code regions.

What it doesn't do, is convert your own code to use interfaces which changed. Most methods are still there though, they're just implemented explicitly, e.g. you have to cast to IEntityCore or IEntity/IEntity2.

As long as the code is in user code regions, that code should be migrated to the v3.5 generated code, as long as you generate that code on top of the 2.6 code.

be aware that some classes have been removed in v3.5

Frans Bouma | Lead developer LLBLGen Pro
bsargos
User
Posts: 6
Joined: 16-Nov-2012
# Posted on: 18-Feb-2013 09:29:01   

Hi Otis, thank you very much for your reply. Of course, I understand that my own code can't be converted. But to my opinion, the problem isnot here. In fact, the llblgen 3.5 engine doesn't overwrite all the methods that became protected and let them as public. Then, I think I have two options : - First, remove from generated files all the methods that don't work anymore, and cast from IEntity2 to IEntityCore in my application. That's what you suggest, right ? - Else, I keep a copy of custom code in each file, and then generate the code in a new folder, without custom code. Then I paste my copied custom code into theses generated files. Unless I missed something, in each case, it's a big task.

Thank you.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39910
Joined: 17-Aug-2003
# Posted on: 18-Feb-2013 14:17:06   

bsargos wrote:

Hi Otis, thank you very much for your reply. Of course, I understand that my own code can't be converted. But to my opinion, the problem isnot here. In fact, the llblgen 3.5 engine doesn't overwrite all the methods that became protected and let them as public. Then, I think I have two options : - First, remove from generated files all the methods that don't work anymore, and cast from IEntity2 to IEntityCore in my application. That's what you suggest, right ?

Could you give some concrete examples of what problems you run into? I have the feeling we're talking about two different things.

All methods are still there. We moved some methods to IEntity2 and IEntityCore to clean up the public interface. In general this doesn't matter much, unless you called these methods a lot (though I then wonder why you'd need to, but I think a concrete example of your code which fails (e.g. a method which doesn't work anymore) would give us more insight in what's wrong exactly)

  • Else, I keep a copy of custom code in each file, and then generate the code in a new folder, without custom code. Then I paste my copied custom code into theses generated files. Unless I missed something, in each case, it's a big task. Thank you.

I think this is a different problem. What I understand is this: 1) you have a problem with methods which are now only available in IEntityCore but your second paragraph suggests: 2) you have a problem with user code regions not being picked up ?

Frans Bouma | Lead developer LLBLGen Pro
bsargos
User
Posts: 6
Joined: 16-Nov-2012
# Posted on: 23-Apr-2013 12:24:34   

Hi Otis, sorry for my late answer, I'm just back to this project and solved the problem today : I was confusing myself between folders... All seems alright now.

Thank you very much for your help.