C# remoting + GAC
-
I've created a remoting application that uses an assembly located in the GAC. When I try to run a client application that grabs the remote object and uses an object in the GAC assembly I get an exception. Everything works fine if the assembly is not signed. Thanks for any help.
System.Runtime.Serialization.SerializationException was unhandled Message="Because of security restrictions, the type PLCLib.PLCMediator+PLCConnection cannot be accessed." Source="mscorlib" StackTrace: Server stack trace: at System.Runtime.Serialization.FormatterServices.GetSafeUninitializedObject(Type type) at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ParseObject(ParseRecord pr) at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Parse(ParseRecord pr) 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.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) at PLCLib.PLCMediator.WriteBit(PLCConnection connection, String dataAddress, Boolean dataIn) at PLCDriverConsole.WriteBit.WriteBits(PLCConnection connection, String dataAddress, Boolean dataIn) in C:\Brad\PLCDriverConsole\PLCDriverConsole
-
I've created a remoting application that uses an assembly located in the GAC. When I try to run a client application that grabs the remote object and uses an object in the GAC assembly I get an exception. Everything works fine if the assembly is not signed. Thanks for any help.
System.Runtime.Serialization.SerializationException was unhandled Message="Because of security restrictions, the type PLCLib.PLCMediator+PLCConnection cannot be accessed." Source="mscorlib" StackTrace: Server stack trace: at System.Runtime.Serialization.FormatterServices.GetSafeUninitializedObject(Type type) at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ParseObject(ParseRecord pr) at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Parse(ParseRecord pr) 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.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) at PLCLib.PLCMediator.WriteBit(PLCConnection connection, String dataAddress, Boolean dataIn) at PLCDriverConsole.WriteBit.WriteBits(PLCConnection connection, String dataAddress, Boolean dataIn) in C:\Brad\PLCDriverConsole\PLCDriverConsole
Dio22 wrote:
"Because of security restrictions, the type PLCLib.PLCMediator+PLCConnection cannot be accessed."
Your problem is noted right there for you.
Just because we can; does not mean we should.
-
Dio22 wrote:
"Because of security restrictions, the type PLCLib.PLCMediator+PLCConnection cannot be accessed."
Your problem is noted right there for you.
Just because we can; does not mean we should.