[Mono-bugs] [Bug 75603][Nor] New - XMLSerializer does not check for or stop on declarative security permissions

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Jul 21 12:32:11 EDT 2005

Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by aaron at synthesyssolutions.com.


--- shadow/75603	2005-07-21 12:32:11.000000000 -0400
+++ shadow/75603.tmp.19687	2005-07-21 12:32:11.000000000 -0400
@@ -0,0 +1,73 @@
+Bug#: 75603
+Product: Mono: Class Libraries
+Version: 1.1
+OS: Debian Woody
+OS Details: OS is Debian Etch, Mono pkgs from Debian Sid
+Status: NEW   
+Priority: Normal
+Component: Sys.XML
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: aaron at synthesyssolutions.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: XMLSerializer does not check for or stop on declarative security permissions
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+I've been developing a webservice on mono and recently put it onto windows
+machine to try using IIS/ASP.net for development. I ran into this exception
+on the windows setup (that I never saw under mono):
+[InvalidOperationException: The property 'TargetSite' on type
+'System.Exception' cannot be serialized because it is decorated with
+declarative security permission attributes. Consider using imperative
+asserts or demands in the property accessors.]
+   System.Xml.Serialization.StructModel.GetPropertyModel(PropertyInfo
+propertyInfo) +346
+   System.Xml.Serialization.StructModel.GetFieldModel(MemberInfo
+memberInfo) +88
+model, String ns) +1534
+model, String ns) +662
+model, String ns) +662
+model, String ns, ImportContext context, String dataType, Boolean repeats) +440
+Steps to reproduce the problem:
+1. Setup a c# webservice under mono, add a method (labeled as a webmethod)
+that returns an exception or takes one as an argument.
+2. Compile and test under a mono setup (go to the asmx file in a browser is
+sufficient to see this).
+3. Then perform the same steps on a windows machine with IIS & MS's .NET
+framework components.
+Actual Results:
+Under mono - no errors
+Under windows - above error
+Expected Results:
+Much as I hate to ask for an exception to be thrown, based on documentation
+from MSDN (link below), Mono should throw this error when these
+circumstances are duplicated.
+How often does this happen? 
+Every time.
+Additional Information:
+Bit of info about declarative security and XML Serialization from MS:
+I appologize if this is a dup, I couldn't find any other bug that seemed
+similar. Thank you for the excellent job you've been doing.

More information about the mono-bugs mailing list