plutoo / protobuf-csharp-port

Automatically exported from code.google.com/p/protobuf-csharp-port
Other
0 stars 0 forks source link

Woking in medium trust #60

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
i use in medium trust application and this error:

-->Inheritance security rules violated while overriding member: 
'Google.ProtocolBuffers.AbstractMessageLite`2<TMessage,TBuilder>.System.Runtime.
Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.Serializa
tionInfo, System.Runtime.Serialization.StreamingContext)'. Security 
accessibility of the overriding method must match the security accessibility of 
the method being overriden.

i found some answer in:
http://stackoverflow.com/questions/3055792/inheritance-security-rules-violated-w
hile-overriding-member-securityruleset-le

need to fixed

Original issue reported on code.google.com by mahdi.us...@gmail.com on 24 Jun 2013 at 6:16

GoogleCodeExporter commented 9 years ago
based on MSDN this class and library can not use in medium trust

because ISerializable.GetObjectData has SecurityCriticalAttribute
http://msdn.microsoft.com/en-us/library/system.security.securitycriticalattribut
e.aspx
"The SecurityCriticalAttribute is equivalent to a link demand for full trust. A 
type or member marked with the SecurityCriticalAttribute can be called only by 
fully trusted code; it does not have to demand specific permissions. It cannot 
be called by partially trusted code."

so need to change some codes to run on medium trust

Original comment by mahdi.us...@gmail.com on 27 Jun 2013 at 7:40

GoogleCodeExporter commented 9 years ago
Have you tried the portable library build for medium trust environments?  I 
believe this excludes serialization.

Original comment by Grig...@gmail.com on 20 Jul 2013 at 4:38

GoogleCodeExporter commented 9 years ago
I suspect this was actually fixed by
https://code.google.com/p/protobuf-csharp-port/source/detail?spec=svn08d8d8b8ae3
dfb871627233f966711a89de767aa&r=d3c7c6a1e16e84c6c3656fb39ea9b9a916fad428

which adds [SecurityCritical] to the relevant methods. Closing as fixed - can 
be reopened if it doesn't work, of course.

Original comment by jonathan.skeet on 15 Feb 2015 at 5:09