I have few projects related to using ChannelSink, ServerSink and ClientSink.
I upgraded projects from .NET 2.0 to .NET 4.0. Before the update, everything worked fine.
Now, when I try to communicate, - for a specific message - my OnReceiveMessage is not called and throws the following exception:
System.Security.SecurityException: request failed
Server stack trace: in System.Array.InternalCreate (Void * elementType, Int32 rank, Int32 * pLengths, Int32 *
pLowerBounds) in System.Array.CreateInstance (type elementType, Int32 Length) in System.Runtime.Serialization.Formatters.Soap.ObjectReader.ParseArray (ParseRecord pr) in System.Runtime.Serialization.Formatters.Soap.ObjectReader.ParseRbord (Par ) in System.Runtime.Serialization.Formatters.Soap.ObjectReader.Parse (ParseRecord pr) System.Runtime.Serialization.Formatters.Soap.SoapHandler.StartChildren () in System.Runtime.Serialization.Formatters.Soap.SoapParser.ParseXML () System.Runtime.Serialization.Formatters.Soap.ObjectReader.Run () System.Runtime.Serialization.Formatters.Soap.ObjectReader.Deserialize (HeaderHandler, ISERParser
serParser) System.Runtime.Serialization.Formatters.Soap.SoapFormatter.Deserialize (Stream serializationStream,
HeaderHandler handler) in System.Runtime.Remoting.Channels.CoreChannel.DeserializeSoapRequestMessage (stream
inputStream, Header [] h, Boolean bStrictBinding) in System.Runtime.Remoting.Chanels.SoapServerFormatterSink.ProcessMessage
(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream
requestStream, IMessage & responseMsg, ITransportHeaders & responseHeaders, Stream & responseStream)
Exception thrown at [0]: in System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage (IMessage reqMsg, IMessage
retMSg) in System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke (MessageData & msgData, type Int32),, (some of my files), Failed to complete the action: Demand Type of the first failure that failed: System.Security.PermissionSet Requirement for:
Only allowed permissions are allowed:
The method that caused this failure: System.Runtime.Remoting.Channels.ServerProcessing ProcessMessage (System.Runtime.Remoting.Channels.IServerChannelSinkStack, System.Runtime.Remoting.Messaging.IMessage, System.Runtime.Remoting.Channels.ITransHport .Stream, System.Runtime.Remoting.Messaging.IMessage ByRef, System.Runtime.Remoting.Channels.ITransportHeaders ByRef, System.IO.Stream ByRef)
The fact is that if I create a fictitious method and add it to the sink, he calls it. even if I use the same proxy that denies this message.
Another thing, other messages work fine. only one type of message does not work out of all created types.