Microsoft KB Archive/327427

= BUG: The attribute flags for the return value of a method are not read =

Article ID: 327427

Article Last Modified on 8/28/2005

-

APPLIES TO


 * Microsoft Visual Studio .NET 2002 Professional Edition

-



This article was previously published under Q327427



SYMPTOMS
When you use reflection to try to find information about a method, there is no way to read the attribute flags for the return value of that method.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.



MORE INFORMATION
The following code contains a type with a method that has a return value that is marked as &quot;[return: MarshalAs(UnmanagedType.U4)]&quot;. public class MyClass {       [return: MarshalAs(UnmanagedType.U4)] public int MyMethod(string hello) {           return 0; } } When you use reflection, you cannot read the parameter attributes for the return value. You can find Information about methods by using the System.Reflection.MethodInfo class. However, this class provides no way for you to get information about attribute flags for return values.

