Reverse the order of the XML comment and the attribute. Quoting from the
language spec (Appendix B) "They must immediately precede a user-defined
type (such as a class, delegate, or interface) or a member (such as a field,
event, property, or method) that they annotate. Attribute sections (§17.2)
are considered part of declarations, so documentation comments must precede
attributes applied to a type or member."
So your code should look like this:
using System;
using System.Runtime.InteropServices;
namespace test
{
/// <summary>Summary description for temp1.</summary>
[ClassInterfaceAttribute(ClassInterfaceType.AutoDua l)]
public class temp1
{
/// <summary></summary>
public temp1() {}
}
}
--
--Grant
This posting is provided "AS IS" with no warranties, and confers no rights.
"RickyJack" <Ri********@att.net> wrote in message
news:76**************************@posting.google.c om...
Using XML comments with the following code works correctly:
using System;
using System.Runtime.InteropServices;
namespace test
{
//[ClassInterfaceAttribute(ClassInterfaceType.AutoDua l)]
/// <summary>Summary description for temp1.</summary>
public class temp1
{
/// <summary></summary>
public temp1() {}
}
}
However, if I uncomment the "//[ClassInterfaceAttribute" line, I get
the following XML comment build errors:
XML comment is not placed on a valid language element
Missing XML comment for publicly visible type or member 'test.temp1'
I need to specify the [ClassInterfaceAttribute so that I can use this
class as a COM component.
Any ideas on how to get XML comments as well as COM Interop??
Thanks,
Rick Webster