PermissionSet Error - Request Error

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.

I did not request a PermissionSet in my application at all, Any help?

+1
source share
1 answer

Pah - I should have guessed that 5 minutes after posting on the stack exchange I would find it. I just had to replace:

<formatter ref="soap" /> 

by

 <formatter ref="soap" typeFilterLevel="Full" /> 

The MSDN documentation for typeFilterLevel explains what happens, although I'm not quite sure why the array is not considered a β€œbase” type

0
source

Source: https://habr.com/ru/post/1345875/


All Articles