BUG: The attribute flags for the return value of a method are not read (327427)



The information in this article 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 "Applies to" section.

MORE INFORMATION

The following code contains a type with a method that has a return value that is marked as "[return: MarshalAs(UnmanagedType.U4)]".
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.

REFERENCES

For more information about reflection, visit the following Microsoft Web site:

Reflection Overview
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconreflectionoverview.asp?

Modification Type:MinorLast Reviewed:8/28/2005
Keywords:kbvs2002sp1sweep kbbug KB327427