Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Warning: Invalid cref value" when targeting .NET Standard 2.1 #6624

Closed
Overlong opened this issue Oct 11, 2020 · 0 comments
Closed

"Warning: Invalid cref value" when targeting .NET Standard 2.1 #6624

Overlong opened this issue Oct 11, 2020 · 0 comments
Labels
dotnet Generate .NET API reference docs

Comments

@Overlong
Copy link

Overlong commented Oct 11, 2020

Operating System: Windows

DocFX Version Used: 2.56.2

Template used: default

Steps to Reproduce:

  1. Create a new .NET Standard Class Library in Visual Studio 2019 Community Edition.
  2. Add a class with XML documentation comments referring to a standard library class:
using System;

namespace DocFxIssue
{
    /// <summary>
    /// This summary refers to the <see cref="Math"/> class.
    /// </summary>
    public class MyClass
    {
    }
}
  1. Install NuGet package docfx.console (version 2.56.2) for the project.
  2. Change target framework from .NET Standard 2.0 to .NET Standard 2.1.
  3. Build project.

Expected Behavior:

  • No warnings when building the project.
  • A reference to the Math class in the generated reference page for the MyClass class:

    This summary refers to the System.Math class.

Actual Behavior:

  • Get warning

    Warning:[MetadataCommand.ExtractMetadata]Invalid cref value "!:Math" found in triple-slash-comments for MyClass defined in MyClass.cs Line 7, ignored.

when building the project.

  • Get no reference to the Math class in the generated reference page for the MyClass class but rather just

    This summary refers to the class.

Remarks:

  • References in seealso and exception tags do not work either.
  • If step 4 is omitted, the expected behavior is observed.
  • Using the fully qualified type name System.Math as cref value does not work.
  • References to other classes in the project do work as expected.

Related issues: The same warning (but probably for other reasons) is observed in issues #628, #1706, #4631, and #5112.

@yufeih yufeih added the dotnet Generate .NET API reference docs label Dec 15, 2022
@yufeih yufeih closed this as completed Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dotnet Generate .NET API reference docs
Projects
None yet
Development

No branches or pull requests

2 participants