Bug 315430 (MONO61296) - New behavior of pseudo custom attributes in 2.0?
Summary: New behavior of pseudo custom attributes in 2.0?
Status: RESOLVED MOVED
Alias: MONO61296
Product: Mono: Runtime
Classification: Mono
Component: misc (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Mono Bugs
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-08 20:15 UTC by Lluis Sanchez
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 18:46:15 UTC


---- Reported by lluis@ximian.com 2004-07-08 13:15:24 MST ----

Try the following test case:

using System;

[Serializable]
public delegate void MyHandler ();

public class Simple
{
	public static void Main(String[] args)
	{
		Console.WriteLine (typeof(MyHandler).GetCustomAttributes (true).Length);
	}
}

Compiling the test case with mcs and gmcs the application always prints
'0', runing in mono or ms.net.
Compiling with ms.net 1.1 it prints '0'
Compiling with ms.net 2.0 and running on ms.net it prints '1'. Running on
mono it prints '0'.

So it seems to be a compiler + runtime issue.



---- Additional Comments From lluis@ximian.com 2004-07-08 13:24:07 MST ----

Weird. It works for attributes other than SerializableAttribute.



---- Additional Comments From lluis@ximian.com 2004-07-08 14:31:08 MST ----

Ok, looks like MS.NET deals with pseudo custom attributes in a
different way. In 1.1 those attributes are not returned by
GetCustomAttributes(), but in 2.0 they are returned. However, they are
not stored as normal attribtues in the metadata. I haven't found yet
documentation about this change.



---- Additional Comments From lupus@ximian.com 2004-07-09 07:39:57 MST ----

A related change about security attributes: they are stored as normal
attributes in the new version instead of as entries in the DeclSecurity
metadata table.



---- Additional Comments From duncan@ximian.com 2004-08-11 20:04:02 MST ----

Sebastien's patch is in #62372, so we'll just merge into that.

*** This bug has been marked as a duplicate of https://bugzilla.novell.com/show_bug.cgi?id=MONO62372 ***


Unknown operating system unknown. Setting to default OS "Other".
This bug was marked DUPLICATE in the database it was moved from.
    Changing resolution to "MOVED"