docfx icon indicating copy to clipboard operation
docfx copied to clipboard

docfx v2 creates wrong metadata for .NET472 project when Visual Studio 2022 gets installed

Open lg2de opened this issue 3 years ago • 1 comments

Operating System: Windows DocFX Version Used: 2.58.4 Steps to Reproduce:

  1. Install VS2019
  2. md c:\temp\docfx && c:\temp\docfx
  3. docfx init --quiet
  4. cd docfx_project\src
  5. dotnet new classlib -f netstandard2.0
  6. change project type to "net472"
  7. Create file IInterface.cs with the content below.
  8. cd ..
  9. docfx metadata --force
  10. check docfx_project\api\src.IInterface.yml
  11. Install VS2022 (preview)
  12. docfx metadata --force
  13. check docfx_project\api\src.IInterface.yml
using System;
using System.Threading;
using System.Threading.Tasks;
namespace src
{
  public interface IInterface
  {
    Task<int> RunAsync(CancellationToken ct);
  }
}

Expected Behavior: The metadata generated for the interface are identical.

Actual Behavior: The "uid" of RunAsync is changed from src.IInterface.RunAsync(System.Threading.CancellationToken) to src.IInterface.RunAsync(CancellationToken)

The name of system types loses the namespace qualifier which causes "invalid cross reference(s)" warnings and broken links.

  1. If VS2019 and VS2022 are installed, how to force docfx to use VS2019?
  2. Are changes in VS2022 required before RTM release? I think the uid should be generated always with the fully qualified name.
  3. I could reproduce the issue so far only with net472. Maybe other targets are affected too.

lg2de avatar Sep 21 '21 13:09 lg2de

I've noticed this is happening for me as well for monoandroid and UWP TFMs, but it works fine for other TFMs. I'm guessing there's some sort of type-lookup issue with docfx for some frameworks.

dotMorten avatar Apr 03 '22 03:04 dotMorten