Best Practise for Partial CLasses and Re-Generation of code

Posts   
 
    
ianvink
User
Posts: 394
Joined: 15-Dec-2006
# Posted on: 29-Dec-2006 00:55:10   

From what I can see there are two options to preserve the custom partial classes I have added to a generated project.

1) Set the **CleanUpVSNetProjects **to false and when I change the schema to remove objects, remove those files manually from the generated code. 2) Set **CleanUpVSNetProjects **to true and each time just re-add the partial classes to the project.

What have other's experiences been?

Cheers, Ian

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 29-Dec-2006 02:55:23   

I don't think it's that bad. I have CleanUpVsNetProjects set to true and files I've added to the project are maintained. So the partial classes should be able to exist regardless of that setting. I believe this may only be true for VS 2005 though.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 29-Dec-2006 10:34:08   

Thats indeed only for vs.net 2005. When you generate, llblgen pro's project file task performer (which creates the project file) adds an xml element to the file element in the project file to signal that the file is generated. When you set clean vs.net projects to true, the files with that element are removed first, and then the ones generated are added again.

Do you experience a different situation? Are your partial classes removed? Because that's not what it should be doing simple_smile

Frans Bouma | Lead developer LLBLGen Pro