By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,885 Members | 1,499 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,885 IT Pros & Developers. It's quick & easy.

CS1574 on <see cref="[explicit interface implementation method]">

P: n/a
public class A : IComparable
{
int IComparable.CompareTo(object obj)
{
return 1;
}
}

/// <summary>
/// <see cref="A.System.IComparable.CompareTo"/>
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
....
}

warning CS1574: XML comment on 'mynamespace
..Form1' has cref attribute 'A.System.IComparable.CompareTo' that could not be found
Nov 15 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
You get this because "A.System.IComparable.CompareTo" is not defined in your
project.
HTH
Brian W

"Gergely Varadi" <tr********@freemail.hu> wrote in message
news:9c**************************@posting.google.c om...
public class A : IComparable
{
int IComparable.CompareTo(object obj)
{
return 1;
}
}

/// <summary>
/// <see cref="A.System.IComparable.CompareTo"/>
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
...
}

warning CS1574: XML comment on 'mynamespace
.Form1' has cref attribute 'A.System.IComparable.CompareTo' that could not

be found
Nov 15 '05 #2

P: n/a
SBNH (Sorry, but not helped) :)

I don't understand your answer. If I extend the previous example with:

public class A : IComparable
{
int IComparable.CompareTo(object obj)
{
return 1;
}

void blabla()
{
}
}

/// <summary>
/// <see cref="A.System.IComparable.CompareTo"/>,
/// <see cref="A.blabla"/>
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
public Form1()
{
InitializeComponent();
A kakukk = new A();
kakukk.blabla();
((IComparable)kakukk).CompareTo(7);
}
}

, the second reference ('<see cref="A.blabla"/>') is accepted, the
first one not. If I watch the model using Reflector, it views
-A
-blabla() : void
-System.IComparable.CompareTo(Object) : Int32

and if I invoke blabla(), the call stack in the debugger is:

TrySerializable.exe!proba46.A.blabla() Line 29 C#

while invoking the CompareTo method:

TrySerializable.exe!proba46.A.System.IComparable.C ompareTo(System.Object
obj = {7}) Line 24 C#

So, what am I doing wrong?

"Brian W" <brianw@gold_death_2_spam_rush.com> wrote in message news:<eJ**************@TK2MSFTNGP11.phx.gbl>...
You get this because "A.System.IComparable.CompareTo" is not defined in your
project.
HTH
Brian W

Nov 15 '05 #3

P: n/a
Simply put, A.System.IComparable.CompareTo does not exist. And the doc
generator seems to have trouble with the interface implementation using that
signature.

IIRC reflection is not used to generate the doc XML, it comes straight from
the source.

Try defining A this way

public class A : IComparable
{
public int CompareTo(object obj)
{
return 1;
}

void blabla()
{
}
}

Then Form1 this way, (note the comment

/// <summary>
/// <see cref="A.CompareTo"/>,
/// <see cref="A.blabla"/>
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
public Form1()
{
InitializeComponent();
A kakukk = new A();
kakukk.blabla();
((IComparable)kakukk).CompareTo(7);
}
}

"Gergely Varadi" <tr********@freemail.hu> wrote in message
news:9c**************************@posting.google.c om...
SBNH (Sorry, but not helped) :)

I don't understand your answer. If I extend the previous example with:

public class A : IComparable
{
int IComparable.CompareTo(object obj)
{
return 1;
}

void blabla()
{
}
}

/// <summary>
/// <see cref="A.System.IComparable.CompareTo"/>,
/// <see cref="A.blabla"/>
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
public Form1()
{
InitializeComponent();
A kakukk = new A();
kakukk.blabla();
((IComparable)kakukk).CompareTo(7);
}
}

, the second reference ('<see cref="A.blabla"/>') is accepted, the
first one not. If I watch the model using Reflector, it views
-A
-blabla() : void
-System.IComparable.CompareTo(Object) : Int32

and if I invoke blabla(), the call stack in the debugger is:

TrySerializable.exe!proba46.A.blabla() Line 29 C#

while invoking the CompareTo method:

TrySerializable.exe!proba46.A.System.IComparable.C ompareTo(System.Object
obj = {7}) Line 24 C#

So, what am I doing wrong?

"Brian W" <brianw@gold_death_2_spam_rush.com> wrote in message

news:<eJ**************@TK2MSFTNGP11.phx.gbl>...
You get this because "A.System.IComparable.CompareTo" is not defined in your project.
HTH
Brian W

Nov 15 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.