Bug 28692

Summary: GetCustomAttributes seems to return attributes in a different order than in windows.
Product: [Mono] Class Libraries Reporter: David Fowler <davidfowl>
Component: mscorlibAssignee: Marek Safar <masafa>
Status: RESOLVED FIXED    
Severity: normal CC: alex.koeplinger, masafa, mono-bugs+mono
Priority: ---    
Version: 3.12.0   
Target Milestone: Untriaged   
Hardware: PC   
OS: Mac OS   
Tags: Is this bug a regression?: ---
Last known good build:

Description David Fowler 2015-04-02 11:55:49 UTC
For instance: https://travis-ci.org/aspnet/Razor/builds/56824259
Comment 1 Marek Safar 2015-04-03 11:14:54 UTC
Could you provide small repro for the issue?
Comment 2 Alexander Köplinger 2015-04-11 10:17:58 UTC
Marek: here's a simple test case:

> using System;
> using System.Diagnostics;
> 
> namespace ConsoleApplication1
> {
>     public class MyAttribute : Attribute
>     {
>     }
>     public class YourAttribute : Attribute
>     {
>     }
> 
>     [YourAttribute]
>     [Serializable]
>     [DebuggerDisplay("test")]
>     [MyAttribute]
>     public class Test
>     {
>     }
> 
>     class Program
>     {
>         static void Main()
>         {
>             var custom = typeof(Test).GetCustomAttributes(false);
>             Console.WriteLine(String.Join(Environment.NewLine, custom));
>         }
>     }
> }

Output on .NET:

> System.Diagnostics.DebuggerDisplayAttribute
> ConsoleApplication1.MyAttribute
> ConsoleApplication1.YourAttribute
> System.SerializableAttribute

Output on Mono:

> ConsoleApplication1.YourAttribute
> ConsoleApplication1.MyAttribute
> System.Diagnostics.DebuggerDisplayAttribute
> System.SerializableAttribute
Comment 3 Marek Safar 2015-04-15 06:49:09 UTC
Fixed in master