Design time binding & re-generating code

Posts   
 
    
omar avatar
omar
User
Posts: 569
Joined: 15-Oct-2004
# Posted on: 02-Jan-2005 14:31:52   

Greetings,

I have a form that is using an entity collection for binding its controls. When I added a new entity to the LLBL project and re-generated the code, I went to that screen to add the collection of the newly added entity. I managed to add the new collection but the icon of the old collection seems to have disappered from the component area for the form. The name of the old collection also does NOT appear in the properties window. In the form's code the declaration of the old collection is still there but no other code (the code creating the instance of the collection and the code binding the text boxes with the collection) is no more there.

I don't know if I am doing something wrong here or this is how the design time binding behaviour of LLBL... cry confused OMAR

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 02-Jan-2005 16:11:55   

You sign your generated code? If so, that's the problem at the moment.

I have to generate a constructor statement for teh entity collection, however I have no idea how to do that (I can't find documentation on that). So I leave it to VS.NET to generate teh proper C#/VB.NET code to initialize the dragged/dropped collection. This is done through serialization (don't ask me why) to the resx file. Which means that if you re-generate the code, and it is signed, it has a new version.

Frans Bouma | Lead developer LLBLGen Pro
omar avatar
omar
User
Posts: 569
Joined: 15-Oct-2004
# Posted on: 03-Jan-2005 03:55:23   

You sign your generated code? If so, that's the problem at the moment.

does this meen that if make my DLLs un-signed then this problem will not appear?

If I must have my DLLs signed, is there any temp workaround for this problem. If I am to go through 60+ screens everytime I re-generate an LLBL project would negate all the RAD benefits of the design time binding. The design time binding is prroving to be a greet time saver and I really want to roll it out in phase 2 of my current project but this problem would meen I should reconsider using the design time binding support cry

any suggestions FRANS

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 03-Jan-2005 10:30:57   

If you sign your assemblies, it gets a new version every time. To prevent that, specify the version yourself in the assemblyinfo class. For example 1.0.0.0 and when you add significant new stuff: 1.0.0.1

To prevent losing your collections binding at runtime, you should add an assembly redirect to your .config file, similar to the ones present in llblgenpro.exe.config.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 03-Jan-2005 13:52:04   

Hang on, Omar, I'm almost there in fixing this issue. The code already generates fine now:

this.entityCollection1.EntityFactoryToUse = new Northwind.Adapter.FactoryClasses.EmployeesEntityFactory();

I just have to make sure it resets the code (i.e. regenerates all code in InitializeComponent) when I set the factory to something else. Expect a fix which will never break your code again, very soon.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 03-Jan-2005 15:51:51   

Ok, I've managed to fix this! simple_smile I thought that day would never come.

A hotfix for the runtime libraries is now available which fixes the code generation in the InitializeComponent method of the form.

NOTE: this code generation has to be REtriggered for existing forms! So any change on the form will do that. You can check if the code has been regenerated successfully if the entity factory isn't serialized back from the resource file but simply instantiated using new.

Frans Bouma | Lead developer LLBLGen Pro
omar avatar
omar
User
Posts: 569
Joined: 15-Oct-2004
# Posted on: 03-Jan-2005 19:32:11   

FRANS.. whenever I think it can't get better, you prove me wrong

LLBL is great but FRANS really rocks wink

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 03-Jan-2005 20:21:17   

simple_smile My pleasure, Omar simple_smile

Frans Bouma | Lead developer LLBLGen Pro