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

[Bug] DotnetApiCatalog.GenerateManagedReferenceYamlFiles() hangs indefinitely on 2.76.0 #9988

Closed
jwfx opened this issue Jun 5, 2024 · 3 comments
Labels
bug A bug to fix

Comments

@jwfx
Copy link
Contributor

jwfx commented Jun 5, 2024

Describe the bug
Calling DotnetApiCatalog.GenerateManagedReferenceYamlFiles() from a C# application works when when referencing Docfx.App 2.75.3 but hangs indefinitely after restoring when updating to 2.76.0

To Reproduce
Steps to reproduce the behavior:

  1. Clone https://github.com/jwfx/DocFxHangRepro
  2. dotnet run in DocFxHangRepro console app folder

Expected behavior
GenerateManagedReferenceYamlFiles() should not hang.

Context (please complete the following information):

  • OS: Windows 10 x64
  • Docfx version: 2.76.0
  • .NET SDK 8.0.300
@jwfx jwfx added the bug A bug to fix label Jun 5, 2024
@filzrev
Copy link
Contributor

filzrev commented Jun 6, 2024

It seems that issue caused by BuildHost related contentFiles (that introduced at Roslyn 4.9.2) are not copied to bin directories when using Docfx.App package.

As a workaround.
Add following package dependencies to DocFxHangRepro.csproj.

<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.9.2" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.9.2" />

By adding these settings. related contentFiles are copied to bin directory.

I'll update following docs later.
https://dotnet.github.io/docfx/index.html#use-the-nuget-library

@jwfx
Copy link
Contributor Author

jwfx commented Jun 6, 2024

Thank you for your swift response.

The workaround does the trick.

@filzrev
Copy link
Contributor

filzrev commented Jul 1, 2024

@yufeih
Please close this issue.
Because related document is updated by #9944.

@yufeih yufeih closed this as completed Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug to fix
Projects
None yet
Development

No branches or pull requests

3 participants