7

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

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

我得到一个模棱两可的参考“警告为错误”,但奇怪的是它是由于 LibCURL 源文件之一中的 CREF 参考而发生的(见下文)。名为 Easy.GetInfo() 的方法确实有几个不同的重载,但我不知道如何解决这个问题,因为有问题的代码不是对 Easy.GetInfo() 的方法调用,实际上它不是代码根本没有,而是它是枚举注释中的 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
{
    ...

注意:我将 LibCURL.NET 重新定位为 .NET 框架版本 4.5.1。我提到这一点以防它可能相关。

4

2 回答 2

8

在 Twitter 上得到了答案,感谢 Peter Foot。这确实是一个晦涩难懂的解决方案,所以我把它放在这里供其他人作为社区 Wiki 答案查找。我所要做的就是在 CREF 目标前面加上“o:”,这告诉编译器接受对重载函数的引用。见下文:

    /// <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>
于 2015-11-02T05:01:19.713 回答
3

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

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

此外,在您的参数类型涉及泛型的情况下,您必须转义<and>字符。在我的情况下,function(IList<uint>)必须写function(IList&lt;uint&gt;)

于 2018-09-18T10:04:39.087 回答