-1

This is the code:

Dim serverProv As New System.Runtime.Remoting.Channels.BinaryServerFormatterSinkProvider
serverProv.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full
Dim clientProv As New System.Runtime.Remoting.Channels.BinaryClientFormatterSinkProvider
Dim props As New System.Collections.Hashtable
props("port") = 0 ' Implies client should use an available port!
Dim m_channel As New TcpChannel(props,clientProv, serverProv)
ChannelServices.RegisterChannel(channel) 
iRemoteClientServer = CType(Activator.GetObject(GetType(ABC.XYZ.Interfaces.IClientServer),sAddress,ABC.XYZ.Interfaces.IClientServer)
iRemoteClientServer.Process(oContext) -- Object containing the data which is processed by a function Process in a windows service -- Thsi is the line that throws the exception shown above

This error is thrown when we are passing custom objects to a windows service from a VB.NET DLL This is on a machine with .NET framework 1.1 , 2.0 and 4.0 installed. Any help here is greatly appreciated.

System.IndexOutOfRangeException: Index was outside the bounds of the array.

Server stack trace: 
   at System.Runtime.Serialization.Formatters.Binary.ReadObjectInfo.GetMemberTypes(String[] inMemberNames)
   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, IMethodCallMessage methodCallMessage)
   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, IMethodCallMessage methodCallMessage)
   at System.Runtime.Remoting.Channels.CoreChannel.DeserializeBinaryRequestMessage(String objectUri, Stream inputStream, Boolean bStrictBinding, TypeFilterLevel securityLevel)
   at System.Runtime.Remoting.Channels.BinaryServerFormatterSink.ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, Stream& responseStream)

Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
Jehof
  • 34,674
  • 10
  • 123
  • 155
  • Without more information it's going to be very hard to help you. The exception itself is pretty self-explanatory - where does it occur in the code? – Tim Sep 30 '12 at 08:05
  • From a VB.NET dll we are remoting to a windows service and we are passing a hashtable as a parameter to the method call. Before this method call we just send a string in a different call and it is received by the windows service properly but when we send a hashtable over a different call with the same server object the call doesnt even reach windows service and it errors out with the above error. The same call works fine on a windows server 2003 box with just framework 1.1 (SP1) and 2.0 SP2 installed. But on a win server 2008 r2 box the above issue manifests itself. – sai surya kiran Sep 30 '12 at 08:23
  • It could be a framework issue - 1.1 is not supported beyond Windows 2003 I believe, though it can be tricked into working on 2008 box (I had to do that a few months back). – Tim Sep 30 '12 at 08:24
  • Hi Tim - thanks for the answer - What did you have to do to trick it into working on a 2008 box? Please elaborate so i can see if it fits my bill here. – sai surya kiran Sep 30 '12 at 08:26
  • I don't remember exactly, but this link looks to be the one I used: [Installing .Net 1.1 applications on Windows Server 2008 R2](http://blogs.charteris.com/blogs/ivorb/archive/2010/07/15/installing-net-1-1-applications-on-windows-server-2008-r2.aspx) – Tim Sep 30 '12 at 08:29
  • Well for starters the code you have does not help anybody because its just not code its the error. If you show us the code then I can help you but else nobody here will be able to help you. – ExcelledProducts Sep 30 '12 at 15:32
  • Excelled Products / Tim - added the sample code which consistently keeps throwing the exception shown above – sai surya kiran Oct 01 '12 at 05:34
  • All - For those of you who are facing this issue :- Just wanted to post the solution that Installing this HotFix from Microsoft nailed this issue: http://archive.msdn.microsoft.com/KB907262/Release/ProjectReleases.aspx?ReleaseId=772 – sai surya kiran Oct 09 '12 at 05:43

1 Answers1

1

Just wanted to post the solution that Installing this HotFix from Microsoft nailed this issue: http://archive.msdn.microsoft.com/KB907262/Release/ProjectReleases.aspx?ReleaseId=772