SerializationException on start web application

Posts   
 
    
Posts: 67
Joined: 10-Jun-2009
# Posted on: 23-Nov-2009 10:58:15   

I'm not sure whether this is a problem in llblGen, but since the error states ORMSupportClasses, I'll give it a try.

On our web server, we have a web application using llblgen installed on IIS7 (windows server 2008 ) and it works just fine.

After installation on a server of one of our clients (Windows server 2003, IIS 6), we get the following error in the event viewer: Message: Unable to find assembly 'SD.LLBLGen.Pro.ORMSupportClasses.NET20, Version=2.6.0.0, Culture=neutral, PublicKeyToken=ca73b74ba4e3ff27'.

The PublicKeyToken is a bit strange, because I don't use the Global Assembly Cache. I just want to use the binaries installed in the dll. folder. So I've checked the web.config and the entire application for a reference to the dll with the PublicKeyToken. However, there is no reference to the dll in the entire application.

Why is it trying to access the Global Assembly Cache, for no reason. Does anyone has a clue?

For testing purposes, I copied the binary to the GAC, but that didn't help either. I got the same error, but on the binary which is the project generated by llblGen.

Stacktrace:

Exception: System.Runtime.Serialization.SerializationException

Message: Unable to find assembly 'SD.LLBLGen.Pro.ORMSupportClasses.NET20, Version=2.6.0.0, Culture=neutral, PublicKeyToken=ca73b74ba4e3ff27'.

StackTrace: at System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly()
   at System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name)
   at System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(String objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
   at System.Runtime.Serialization.Formatters.Binary.ObjectMap.Create(String name, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
   at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
   at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryHeaderEnum binaryHeaderEnum)
   at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
   at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
   at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeObject(MemoryStream stm)
   at System.AppDomain.Deserialize(Byte[] blob)
   at System.AppDomain.UnmarshalObject(Byte[] blob)
Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 23-Nov-2009 14:16:39   

I'm not sure it tries to access the GAC.

Anyway, what's the file version of the 'SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll' deployed at the client's?

Posts: 67
Joined: 10-Jun-2009
# Posted on: 23-Nov-2009 14:31:32   

Assembly Version 2.6.0.0 File Version 2.6.09.0511

I assumed it was searching the Global Assembly Cache because the exception shows the strong name of the assembly. Wrong assumption?

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 23-Nov-2009 14:55:45   

You've mentioned that you get this in the event viewer, but actually does your application complain about this exception?

if yes, then would you please post the code snippet which throws this exception.

Posts: 67
Joined: 10-Jun-2009
# Posted on: 23-Nov-2009 14:59:20   

No, the application itself doesn't complain at all. It does work, but it seems the application is recycled after the error.

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 24-Nov-2009 11:31:13   

Please try Assembly Binding Log Viewer to find more information on where the .Net framework is looking for the assembly and why it can't load it.

Posts: 67
Joined: 10-Jun-2009
# Posted on: 25-Nov-2009 11:50:05   

I had a hard time trying to get the Assembly Binding Log Viewer installed on the production server of our client.

When I examined the process list, I encountered another error: the JIT-debugger from Visual Studio was waiting for input from the administrator for a QueryExecutionException. I was suprised to see that, because all errors in the application should be sent to a webservice.

Anyway, the error was thrown because a table in the database was missing. When I added the table, not only was the QueryExecutionException gone, but also the SerializationException wasn't thrown.

I deleted and added the table for several times: Every time the table was missing, I got the SerializationException in the Event Viewer. Once the table was present, no error occured.

Can anybody explain this? Anyway, my application is fixed, answer is for future reference :-) Thanxs for your help!

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 25-Nov-2009 12:11:21   

Now I think it is making some sense simple_smile .

Your issue looks similar to the one described here: http://agilior.pt/blogs/pedro.rainho/archive/2009/03/24/7397.aspx

at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeObject(MemoryStream stm) at System.AppDomain.Deserialize(Byte[] blob) at System.AppDomain.UnmarshalObject(Byte[] blob)

You are serializing the exception (QueryExecutionException) to the webService (accross appDomains). And the deserilaization code is looking for the ORMSupportClasses dll to deserilaize the exception sent over the wire.