Wierd Error

Posts   
 
    
Answer
User
Posts: 363
Joined: 28-Jun-2004
# Posted on: 08-Jun-2006 20:53:55   

I once in a while get a wierd error when building a project, and ic ant seem to figure out what or why its doing it. I ahve to close the IDE down, delete the bin and obj directories and restart the ide, normally this solves it, something though i have to reboot the computer.


Error   5   The "GenerateResource" task failed unexpectedly.
System.Reflection.TargetInvocationException: Type  in the data at line 141, position 5, cannot be loaded because it threw the following exception during construction: Invalid cast from 'SD.LLBLGen.Pro.ORMSupportClasses.EntityState' to 'SD.LLBLGen.Pro.ORMSupportClasses.EntityState'. ---> System.Xml.XmlException: Type  in the data at line 141, position 5, cannot be loaded because it threw the following exception during construction: Invalid cast from 'SD.LLBLGen.Pro.ORMSupportClasses.EntityState' to 'SD.LLBLGen.Pro.ORMSupportClasses.EntityState'. Line 141, position 5. ---> System.InvalidCastException: Invalid cast from 'SD.LLBLGen.Pro.ORMSupportClasses.EntityState' to 'SD.LLBLGen.Pro.ORMSupportClasses.EntityState'.
   at System.Convert.DefaultToType(IConvertible value, Type targetType, IFormatProvider provider)
   at System.Enum.System.IConvertible.ToType(Type type, IFormatProvider provider)
   at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
   at System.Runtime.Serialization.FormatterConverter.Convert(Object value, Type type)
   at System.Runtime.Serialization.SerializationInfo.GetValue(String name, Type type)
   at SD.LLBLGen.Pro.ORMSupportClasses.EntityBase2..ctor(SerializationInfo info, StreamingContext context)
   at Mingus.Data.Application.EntityClasses.ItemEntity..ctor(SerializationInfo info, StreamingContext context) in C:\devel\Mingus\src\Mingus.Data.Application\EntityClasses\ItemEntity.cs:line 101
   --- 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.GenerateResource.Execute()
   at Microsoft.Build.BuildEngine.TaskEngine.ExecuteTask(ExecutionMode howToExecuteTask, Hashtable projectItemsAvailableToTask, BuildPropertyGroup projectPropertiesAvailableToTask, Boolean& taskClassWasFound)    Mingus.UI.ManagementStudio.ApplicationCore


Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 08-Jun-2006 21:58:55   

You have an entity dragged onto a form ? (in combination of a bindingsource) ?

Frans Bouma | Lead developer LLBLGen Pro
Answer
User
Posts: 363
Joined: 28-Jun-2004
# Posted on: 09-Jun-2006 17:13:24   

i have a bindingsource dragged onto a form, and its using an object datasource thats an entity.

There is some serious bugs in winforms databinding and its really starting to piss me off...i have to reboot my ide all the time to solve these issues...

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 09-Jun-2006 17:30:14   

The issue is: (Guessing here, but I think it's this) you've opened vs.net, opened the form. At that point, vs.net loads the ormsupportclasses dll.

You update the beta, try to recompile. clunk, it won't work, because the form tries to deserialize the object from the resx file, (its binary serialized into that file) though it doesn't match the type of the currently active dll used by the build.

Cleaning the solution, will sometimes help.

But I'm with you when it comes to the bugs in winforms. In the llblgen pro designer there are 2 forms with a usercontrol on them. I can't open them anymore in the vs.net form designer of vs.net 2005 because the designer's code generator is so incredibly buggy, it forgets to emit a constructor call for the usercontrol! So the designer crashes that it runs into a null reference (duh) so the designer gives up. rage

Frans Bouma | Lead developer LLBLGen Pro
Answer
User
Posts: 363
Joined: 28-Jun-2004
# Posted on: 09-Jun-2006 18:20:23   

That makes a lot of sense, since these issues really started popping up after i starting using the beta of lblgen v2.

So it looks like i will have to do without design time databinding for at least a while until llblgen is no longer in beta. Does webforms have these same problems?

Maybe i should switch my project to web based, although i really prefer a real windows app wink

Answer
User
Posts: 363
Joined: 28-Jun-2004
# Posted on: 09-Jun-2006 18:22:41   

I wonder if generating an interface for each entity would solve this issue?? then have the object data source bind to the interface......

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 09-Jun-2006 18:52:10   

That doesn't matter much, it serializes the real type into the file. What I don't get is that it breaks. It should work normally, as there's nothing changed in the serialization code.

Do you see this error everytime after you've switched a beta, or do you see it no matter what changed in the beta, so you see it in the morning, you compile close vs.net etc. and in the afternoon you see it happen again (without changing the beta to a newer version) ?

Frans Bouma | Lead developer LLBLGen Pro
Answer
User
Posts: 363
Joined: 28-Jun-2004
# Posted on: 09-Jun-2006 19:55:57   

well, i believe it have gotten it both times. Its pretty random actually. it will do it for just no apparent reason, i know its done it before when i havent changed the runtime libs.

And another thing that i get all the time that is actually more common, is not being able to compile the project becuase the dbgeneric project dll is locked by visual studio for some stupid reason. Betweent he two errors, if i had any hair, i would be pulling it out!

I have suspected for a while though that it has something to do with the design time databinding...

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 13-Jun-2006 11:49:13   

As your wicked remoting errors went away, please keep me posted if this error re-occurs again. If It does, please let me know if something changed (like you installed a new beta etc. )

Frans Bouma | Lead developer LLBLGen Pro
Answer
User
Posts: 363
Joined: 28-Jun-2004
# Posted on: 13-Jun-2006 17:19:58   

Will Do smile

I got so pissed last week, i completly rebuilt the solution from scratch. Im not getting those errors anymore more (knock on wood) but i do get LoaderExceptions which seem to be a common problem with vs2005

I have to say though, that i read turning off the autorecover feature and the edit+continue support makes the ide more more stable, and so far i have to agree. its only been off for like 8 hrs, but i havent gotten a loader exceptions since simple_smile

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 14-Jun-2006 12:26:15   

Hmm, that would be a really sad signal that VS.NET 2005 isn't good. Good tip btw to disable E&C. I don't use E&C at all, and no-one really should actually as it teaches bad coding style IMHO (but others think different about that) so if I could make vs.net 2005 more stable by disabling it, it would be great! smile

Frans Bouma | Lead developer LLBLGen Pro
Meteor
User
Posts: 67
Joined: 06-Apr-2007
# Posted on: 24-Mar-2009 05:45:48   

I'm getting pretty much the same error now from vs2008.

Can't open my main form in the designer. Also, I am unable (since this morning) to set the 'EntityFactory to use' on any of the 10 or so entitycollection components i have on my main form.

This is despite cleaning, rebuilding, rebooting, restarting vs2008 and all the other guff you normally have to do to resolve it.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 24-Mar-2009 10:42:01   

Web or winforms?

Frans Bouma | Lead developer LLBLGen Pro
Anthony
User
Posts: 155
Joined: 04-Oct-2006
# Posted on: 08-Dec-2009 00:11:51   

winforms,llblgen 2.6, vb.net vs2008,adapter

i have the same error any solution?

37 Invalid Resx file. Type in the data at line 178, position 5, cannot be loaded because it threw the following exception during construction: Invalid cast from 'SD.LLBLGen.Pro.ORMSupportClasses.EntityState' to 'SD.LLBLGen.Pro.ORMSupportClasses.EntityState'.

It starting happening after i migrated from vs2005 to vs 2008

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 08-Dec-2009 08:28:50   

Which build of the SD.LLBLGen.Pro.ORMSupportClasses.dll are you using?

Please try to remove its reference from your project, and then re-add it again. (make sure you usie the .NET2.0+ one)

P.S. Next time please open a new thread, instead of re-using an old one.