Error compiling WinForms app while upgrading from 1.2005.1 to 2

Posts   
 
    
JimHugh
User
Posts: 191
Joined: 16-Nov-2005
# Posted on: 24-Jul-2006 03:04:52   

I am upgrading a WinForms application using VS2005 and the 7/12 (also tried 7/22) release of LLBLGen 2.

Fixed all of the other breaking code changes but am left with one compile time error.

I had previously dragged EntityCollections from 1.2005.1 onto WinForms and set the datasource of a bindingsource to the entitycollection instance and the form controls datasource to the bindingsource.

It was all working well up until the upgrade attempt.

I also created a new winforms test app and referenced the new Generic and DBSpecific generated libraries and was able to use them (very brief test).

Any idea how I can edit the upgraded app serialized resource files to add the concurrencyPredicateFactoryToUse' property? Or otherwise fix the code.

I have cleaned the solution and verified all of the references and tried to rebuild the solutoin.

BTW, I was not using concurrencyPredicateFactories yet...

(renamed actual app name to MyTetUI)


Error   1   The "GenerateResource" task failed unexpectedly.
System.Reflection.TargetInvocationException: Type  in the data at line 132, position 5, cannot be loaded because it threw the following exception during construction: Member '_concurrencyPredicateFactoryToUse' was not found. ---> System.Xml.XmlException: Type  in the data at line 132, position 5, cannot be loaded because it threw the following exception during construction: Member '_concurrencyPredicateFactoryToUse' was not found. Line 132, position 5. ---> System.Runtime.Serialization.SerializationException: Member ' ' was not found.
   at System.Runtime.Serialization.SerializationInfo.GetElement(String name, Type& foundType)
   at System.Runtime.Serialization.SerializationInfo.GetValue(String name, Type type)
   at SD.LLBLGen.Pro.ORMSupportClasses.CollectionCore`1..ctor(SerializationInfo info, StreamingContext context)
   at SD.LLBLGen.Pro.ORMSupportClasses.EntityCollectionBase2`1..ctor(SerializationInfo info, StreamingContext context)
   at SD.LLBLGen.Pro.ORMSupportClasses.EntityCollectionNonGeneric..ctor(SerializationInfo info, StreamingContext context)
   at HTI.FFBL.HelperClasses.EntityCollection..ctor(SerializationInfo info, StreamingContext context) in C:\Code\HTI\Apps\MyTestApp\MyTestApp3\FFBL2\DatabaseGeneric\HelperClasses\EntityCollection.cs:line 53
   --- End of inner exception stack trace ---

   --- End of inner exception stack trace ---
   at Microsoft.Build.Shared.ExceptionHandling.RethrowUnlessFileIO(Exception e)
   at Microsoft.Build.Tasks.ProcessResourceFiles.ProcessFile(String inFile, String outFile)
   at Microsoft.Build.Tasks.ProcessResourceFiles.Run(TaskLoggingHelper log, ITaskItem[] assemblyFilesList, ArrayList inputs, ArrayList outputs, Boolean sourcePath, String language, String namespacename, String filename, String classname, Boolean publicClass)
   at Microsoft.Build.Tasks.ProcessResourceFiles.Run(TaskLoggingHelper log, ITaskItem[] assemblyFilesList, ArrayList inputs, ArrayList outputs, Boolean sourcePath, String language, String namespacename, String filename, String classname, Boolean publicClass)
   at Microsoft.Build.Tasks.GenerateResource.Execute()
   at Microsoft.Build.BuildEngine.TaskEngine.ExecuteTask(ExecutionMode howToExecuteTask, Hashtable projectItemsAvailableToTask, BuildPropertyGroup projectPropertiesAvailableToTask, Boolean& taskClassWasFound)    MyTestAppUI


Walaa avatar
Walaa
Support Team
Posts: 14994
Joined: 21-Aug-2005
# Posted on: 24-Jul-2006 06:21:19   

Would you please re-build your solution (clean intermediate files)?

Also check the following thread for some relevant suggestions: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=6166

JimHugh
User
Posts: 191
Joined: 16-Nov-2005
# Posted on: 24-Jul-2006 06:45:59   

Walaa wrote:

Would you please re-build your solution (clean intermediate files)?

Also check the following thread for some relevant suggestions: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=6166

Thank you for the reply.

I cleaned the solution and tried to rebuild it prior to posting. Still got same error.

I did search the forum for GenerateResource and for _concurrencyPredicateFactoryToUse and found that thread previously. Did not seem to apply, especially since the original poster said he fixed his project, but not HOW.

I do get an error while attempting to open forms in design mode that have EntityCollection objects dragged from the toolbox.

Since my original post, I changed the references to V2 and my V2 libraries back to the 1.2005.1 versions and added #if #else #end if sections around the breaking code sections and am able to open in design mode, compile and run without errors under 1.2005.1

Going back to 2 breaks it again.

I don't mind doing it all in code behind EXCEPT for the design time grid databindng that is already in place. If I remove the EntityCollection components, I lose that. rage

Walaa avatar
Walaa
Support Team
Posts: 14994
Joined: 21-Aug-2005
# Posted on: 24-Jul-2006 07:06:30   

When you open the form in V.1 try to remove the EntityCollection from the form, then to change the references to V2 and re-open the form (I suppose it should open now), then re-add the EntityCollection, also it's recommended to use a BindingSource control.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39888
Joined: 17-Aug-2003
# Posted on: 24-Jul-2006 09:08:22   

It's odd, as the class implements ISerializable, so this error should never happen (I also haven't seen it with my testapps when migrating)

The serialized code is in the .resx file. Cutting out the block of serialized data in the resx file sometimes helps, but it could also render the file useless.. I don't have a remedy for this. The ConcurrencyPredicateFactoryToUse property and the member are there, so it's very weird it gives this error.

Frans Bouma | Lead developer LLBLGen Pro
JimHugh
User
Posts: 191
Joined: 16-Nov-2005
# Posted on: 24-Jul-2006 14:52:12   

Walaa wrote:

When you open the form in V.1 try to remove the EntityCollection from the form, then to change the references to V2 and re-open the form (I suppose it should open now), then re-add the EntityCollection, also it's recommended to use a BindingSource control.

I am using BindingSource ( as mentioned in initial post).

Removing the EntityCollection object from the form, even when using a BindingSource, resets the DataGridView column settings, which is what I was trying to avoid.

JimHugh
User
Posts: 191
Joined: 16-Nov-2005
# Posted on: 24-Jul-2006 17:14:51   

Otis wrote:

The serialized code is in the .resx file. Cutting out the block of serialized data in the resx file sometimes helps, but it could also render the file useless.. I don't have a remedy for this. The ConcurrencyPredicateFactoryToUse property and the member are there, so it's very weird it gives this error.

If I could figure out which file it was in, I would be willing to give it a try. simple_smile

VS2005 is not showing a File, Line or Column. just the one big GenerateTask failed error initially posted.

I've tried searching using UltraEdit's Find in Files in the whole solution folder for likely strings and can't find anything yet...

I'll create a test app at 1.2005 and try to upgrade it to 2.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39888
Joined: 17-Aug-2003
# Posted on: 24-Jul-2006 18:23:32   

You have no EntityCollection mentioned in the resx file of the particular form? That's strange... also not under the name you gave to the EntityCollection object on the form?

Frans Bouma | Lead developer LLBLGen Pro
JimHugh
User
Posts: 191
Joined: 16-Nov-2005
# Posted on: 24-Jul-2006 19:59:18   

Otis wrote:

You have no EntityCollection mentioned in the resx file of the particular form? That's strange... also not under the name you gave to the EntityCollection object on the form?

I finally hacked my way through it.

The references in the resx files were to the *.DataSource property.

I did end up having to delete it out of the resx files and rebuild the grid layout.

What is weird is that it did not do it to all forms, just a couple and a couple of usercontrols.

what a pita, but not your fault (direclty). I blame it on VS2005 and serialazation.