-1

So intermittently I am getting an Exception written out to my server's Event Logs from something bad happening in WCF.

This Exception happens at the same time as a "System.TimeoutException" for an async callback to the client. I guess the serialization problem causes the timeout issue, because the calls are not all that long.

The client side sometimes logs a stacktrace including "The server did not provide a meaningful reply" when it gets its async answer back from the service.

So the "bin" folder for my web service contains a copy of My.Org.Core DLL with version 2.0.0.0 however the stacktrace refers to version 1.8.0.0! I searched my entire solution for any mention of this old 1.8.0.0 and it cannot be found! Please help.

Here is the serialization problem:

An unhandled exception occurred and the process was terminated.

Application ID: DefaultDomain

Process ID: xxxx

Exception: System.Runtime.Serialization.SerializationException

Message: Unable to find assembly 'My.Org.Core, Version=1.8.0.0, Culture=neutral, PublicKeyToken=null'.

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.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
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)
Eric
  • 786
  • 1
  • 9
  • 16
  • Try to roleback dll using nuget.So that particular version of dll is removed .Refer this https://stackoverflow.com/questions/10206090/how-to-install-an-older-version-of-package-via-nuget and alter accordingly. – Hameed Syed Oct 29 '17 at 17:53

4 Answers4

0

It seems actual error is something else and caused due to some un-handled error in WCF service.

This is because when an unhandled exception is thrown in a ASP.NET-based application the application unexpectedly quits. When this problem occurs, no exception information that you must have to understanding the issue is logged in the Application log.

So to get actual error,

  • Try adding try-catch blocks to code (some global error handling or for every service method) and check error logs
  • Or to check actual error, follow steps from this article (Method 1, don't go for Method 2 from article) and will log the actual error.

Hope it helps.

Shah
  • 1,319
  • 1
  • 13
  • 18
0

1- If you have multi projects in one solution you should open every project file that referenced old version DLL and replace it with new version.

2- I suggest to you if you have model in a separated class library and to prevent any type of serialization exception add you serialization contract to AssemblyInfo.cs in that class library like this:

[assembly: AssemblyProduct("blah.Data.Domain")]

and you contract can be like this:

[assembly: ContractNamespace("http://blah.xyz/test",  ClrNamespace = "blah.Data.Domain"

this contract serialization apply to all model inside class library.

Alireza
  • 128
  • 1
  • 12
0

As you have mentioned the stacktrace referring to the old version of dll, Is there any chance you have the old DLL registered in GAC?

0

So dll version is the issue.

Error :My.Org.Core, Version=1.8.0.0 coudlnt be found

Expected dll as per you is My.Org.Core, Version=2.0.0.0.

First step is to look for that dll in your GAC.

RUN then type %windir%\assembly\GAC_MSIL ,now dive deep to see or search the My.Org dll,right click and if found check the version.If not found ,then you dont have the dll.It means you dont have My.Org.Core, Version=1.8.0.0 dll neither in your bin/solution or GAC.

Looks like this is your internal organization dll.So get the 1.8.0.0 th dll and put it in your bin folder and restart the client service.

Why you are missing the dll? Probably when the client application was build,the dll was being referenced from GAC and hence in the developer machine didnt face this issue.

How to avoid such situation ? While the application build/deployed set the property copy to local true so that while the application is build,that particular dll is dropped in the package or bin folder explicitly and no need to refer from the GAC.But obviously it will increase the build time.

Hameed Syed
  • 3,939
  • 2
  • 21
  • 31