473,385 Members | 2,015 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

XML comment problem with [ClassInterfaceAttribute(...

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
Nov 13 '05 #1
3 5472
I suspect that you'd need your comments above the attribute and not below
it.
-chris

On 9 Jul 2003 08:24:19 -0700, RickyJack <Ri********@att.net> wrote:
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


--
Chris J. Breisch, MCSD.NET, MCDBA
Nov 13 '05 #2
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

Nov 13 '05 #3
"Grant Richins [MS]" <gr*****@online.microsoft.com> wrote in message news:<Oq**************@TK2MSFTNGP10.phx.gbl>...
Reverse the order of the XML comment and the attribute...


Thanks for the help! Reversing the lines worked. I guess I should have
tried that but I was under the assumption that the XML comment stuff
had to be directly before the class definition.

Regards,
Rick Webster
Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Riko Wichmann | last post by:
Dear all, is there a way in Python to comment out blocks of code without putting a # in front of each line? Somethings like C's /* block of code here is commented out */ Thanks,
0
by: dixie | last post by:
I have a form where, if a button is clicked (on), I want the current comment in a form control to remain behind when I click the New Record button. I have a retainer button called CommentRetainer...
1
by: intrader | last post by:
I have a .NET interop assembly Hash.MD5Sum with two methods Identity and GetMD5Sum. I want to call the methods from ASP (JScript), The debugger tells me that object oMD5Sum has one the ToString()...
2
by: intrader | last post by:
I have a .NET interop assembly Hash.MD5Sum with two methods Identity and GetMD5Sum. I want to call the methods from ASP (JScript), The debugger tells me that object oMD5Sum has only one method...
6
by: cdrsir | last post by:
we can use 1) // my comments a 2) /* my comments b */ when we want to add some comments. I know some compilers just support the 2nd syntax, but normally both of these 2 syntaxs are supported...
0
by: =?ISO-8859-2?B?UmFmYbMgR2llemdhs2E=?= | last post by:
This is part of my assembly: // The following GUID is for the ID of the typelib if this project is exposed to COM
0
by: karen987 | last post by:
Could someone please tell me what code to add here? I have a weblog, with daily news which readers can add comments to, which are stored in a database. The form to add the comments is on an ASP page,...
14
by: Siv | last post by:
Hi, Just busily coding away and removed a procedure from my code and all of a sudden an error came up miles away from the location of the piece of code I removed and it relates to the XML...
39
by: polas | last post by:
Afternoon all. I was just wondering about this point - I have (generally) used // for commenting a single line in C, but from looking at code other people have written it seems many use /* */...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.