由于评论中的cref引用,在C#app中出现模糊的引用错误?

时间:2015-11-02 04:11:03

标签: c# .net comments ambiguous libcurl.net

这是我以前从未见过的新问题。它发生在LibCURL.NET的开源包装器中:

http://sourceforge.net/projects/libcurl-net/

我得到一个含糊不清的引用"警告错误",但奇怪的是它发生了由于其中一个LibCURL源文件中的CREF引用(见下文)。对于名为Easy.GetInfo()的方法确实有几个不同的重载,但我不知道如何解决这个问题,因为违规代码不是对Easy.GetInfo()的方法调用实际上它根本不是代码,而是它在Enum的注释中是一个CREF元素。有谁知道如何解决这个问题?

/// <summary>
/// This enumeration is used to extract information associated with an
/// <see cref="Easy"/> transfer. Specifically, a member of this
/// enumeration is passed as the first argument to
/// <see cref="Easy.GetInfo"/> specifying the item to retrieve in the
/// second argument, which is a reference to an <c>int</c>, a
/// <c>double</c>, a <c>string</c>, a <c>DateTime</c> or an <c>object</c>.
/// </summary>
public enum CURLINFO
{
    ...

注意:我为.NET Framework 4.5.1版重新定位了LibCURL.NET。我提到这个可能是相关的。

2 个答案:

答案 0 :(得分:3)

在Twitter上得到答案,谢谢Peter Foot。这真的是一个不起眼的解决方案,所以我把它放在这里供其他人找到社区Wiki答案。我所要做的只是在CREF目标前加上&#34; o:&#34;并告诉编译器接受对重载函数的引用。见下文:

    /// <summary>
    /// Pass a <c>bool</c>. If it is <c>true</c>, libcurl will attempt to get
    /// the modification date of the remote document in this operation. This
    /// requires that the remote server sends the time or replies to a time
    /// querying command. The <see cref="o:Easy.GetInfo"/> function with the
    /// <see cref="CURLINFO.CURLINFO_FILETIME"/> argument can be used after a
    /// transfer to extract the received time (if any).
    /// </summary>

答案 1 :(得分:0)

还可以回答历史记录:您可以通过指定特定的重载函数的参数来引用它。

例如,假设您的Easy.GetInfo有一个以int作为参数的重载,则可以使用<see cref="Easy.GetInfo(int)"/>引用该特定函数。 可以这么说,o:事物似乎“破坏了参考”(我没有详细介绍)

如果您的参数类型涉及泛型,则还必须转义<>字符。就我而言,function(IList<uint>)必须写为function(IList&lt;uint&gt;)