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

Cannot generate proper metadata for record structs #8120

Closed
airbreather opened this issue Aug 2, 2022 · 2 comments
Closed

Cannot generate proper metadata for record structs #8120

airbreather opened this issue Aug 2, 2022 · 2 comments
Labels
dotnet: csharp New features requires to handle C# dotnet Generate .NET API reference docs
Milestone

Comments

@airbreather
Copy link

Operating System: Windows

DocFX Version Used: 2.59.3.0

Template used: whatever docfx-seed uses

Steps to Reproduce:

  1. git clone https://github.com/docascode/docfx-seed
  2. In docfx.json, change src/DotnetNew/*.csproj to DotnetNew/*.csproj
  3. In src/DotnetNew, update the .csproj file's TargetFramework to net6.0 and add a record struct. Examples down below.
  4. docfx docfx.json --serve
  5. Navigate to http://localhost:8080/api/DotnetNew.html

Expected Behavior:

You should see the record struct in the list of types.

Actual Behavior:

Where it should have been, there's a link to DotnetNew..html.

Sample Files:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
  </PropertyGroup>

</Project>
using System;

namespace DotnetNew
{
    // generates just fine:
    public class Class1
    {
    }

    // generates OK, though it could be better
    public record Class2
    {
    }

    // generates just fine:
    public struct Struct1
    {
    }

    // generates just fine:
    public readonly struct Struct2
    {
    }

    // fails:
    public record struct Struct3
    {
    }

    // fails:
    public readonly record struct Struct4
    {
    }
}
@airbreather
Copy link
Author

A workaround might be to build first and do this for the metadata:

"metadata": [
  {
    "src": [
      {
        "files": ["DotnetNew/**/bin/**/Release/**.dll" ],
        "src": "src"
      }
    ],
    "dest": "obj/api"
  }
],

While this also seems to have problems, it's also not the absolute worst...

@yufeih yufeih added dotnet Generate .NET API reference docs dotnet: csharp New features requires to handle C# labels Dec 15, 2022
@yufeih yufeih added this to the Working Set milestone Jan 16, 2023
@yufeih
Copy link
Contributor

yufeih commented Jan 30, 2023

We now support record structs and other latest C# features in the latest version.

@yufeih yufeih closed this as completed Jan 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dotnet: csharp New features requires to handle C# dotnet Generate .NET API reference docs
Projects
None yet
Development

No branches or pull requests

2 participants