docfx: After Visual Studio update - docfx does not work anymore :-(

Operating System: Windows 11 Pro

DocFX Version Used: docfx 2.59.1.0

Template used: statictoc

Steps to Reproduce:

Latest VS update (today) Microsoft Visual Studio Community 2022 (64-bit) - Version 17.2.6

docfx:

Build succeeded with warning. [22-07-13 12:35:02.625]Warning:MetadataCommand.ExtractMetadataWorkspace failed with: [Failure] Msbuild failed when processing the file ‘C:\Users\cohle\Desktop\RationalNumerics\System.Numerics.Rational\System.Numerics.Rational.csproj’ with message: Methode nicht gefunden: “System.ReadOnlySpan1<Char> Microsoft.IO.Path.GetFileName(System.ReadOnlySpan1<Char>)”. [22-07-13 12:35:02.628]Warning:[MetadataCommand.ExtractMetadata]Project ‘C:\Users\cohle\Desktop\RationalNumerics\System.Numerics.Rational\System.Numerics.Rational.csproj’ does not contain any documents. [22-07-13 12:35:02.629]Warning:[MetadataCommand.ExtractMetadata]No metadata is generated for System.Numerics.Rational. 3 Warning(s) 0 Error(s)

For project - URL: https://github.com/c-ohle/RationalNumerics

Any quick workaround?

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 3
  • Comments: 46 (2 by maintainers)

Commits related to this issue

Most upvoted comments

FWIW, while this work around works, it runs MUCH slower.

I don’t think this issue should be closed until VS fixes the underlying issue that broke it!

Here’s the root issue: https://github.com/dotnet/msbuild/issues/7832

I don’t think this issue should be closed until VS fixes the underlying issue that broke it!

The workaround of using the .dll files instead of the .csproj files gives a worse user experience for me than just holding our build server’s version of Visual Studio Build Tools back at 17.2, which is obviously not a viable long-term solution, so I also would appreciate keeping an issue open for this.

For example, using .csproj files, it correctly identifies structs as structs (after finding a better workaround for #8120, anyway), but when using the .dll files, it seems to call them classes that just so happen to inherit from ValueType. I haven’t gone further than that to see if there’s anything else that the .dll version gets “wrong” that the .csproj version gets “right”.

@superyyrrzz ,

In https://github.com/dotnet/docfx/pull/8135, it was asserted this is fixed in VS2022 17.3.1 (not preview)

I can reproduce the issue on

  • VS2022 17.4.0 Preview 1.0
  • VS2022 17.3.1

This issue should not be closed.

I think he root-cause is this MSBuild bug: https://github.com/dotnet/msbuild/issues/7832

With GitHub’s CI images, I only had the problem with windows-latest, the DocFx builds run fine for me on ubuntu-latest and macos-latest.

This fix works fine Thanks you! That saved me 😅

Our changes: here

Hope microsoft still fixes it tho.

@vers-one thanks for the other method, didn’t test tho because the first one is easier for me

This workaround proposed by jskeet works even with windows-latest for me.

the workaround isn’t appropriate when trying to run this in CI. DocFX should work out of the box, without these workarounds.

While I can’t reopen it personally, I’ve been waiting for the supposed fix to make it into a new release of docfx.console so that I can try it out myself before asking for anything further to be done about this.

@asklar After updating my docfx.console reference to 2.59.4, I can confirm that the issue is completely resolved for me.

With GitHub’s CI images, I only had the problem with windows-latest, the DocFx builds run fine for me on ubuntu-latest and macos-latest.

  • Package ref to docfx.console 2.59.3 in a NoTargets project.
  • Explicit SDK version 6.0.400 in global.json
  • csproj sources in docfx.json
  • Explicitly build the sources before the docs.

Successful CI run with docfx build on Windows disabled: https://github.com/mawosoft/Mawosoft.Extensions.BenchmarkDotNet/actions/runs/2944501729

This issue has caused my GH Action to error out, but only on one of my projects. Is there a work around other than “ship the dll” because I dont want my documentation workflow to have to borrow actions from my release.

FYI, we have the same exception, that started appearing with 17.3 Preview 3 in Uno, possibly in our Source Generators, for users that had LangVersion forced at 8.0 in their project: https://github.com/unoplatform/uno/issues/9297

Great, it works, (After delete the cache of course 😃 )

image

Having the same issues with other tooling (not docfx). I suspect that it is something that changed in MSBuild (I do have preview installed, but it also happens to the stable versions).

Maybe the SDK version that shipped last Patch Tuesday?

Morning, it seems to be a Microsoft issue. I debugged docfx (unchanged). As you can see, it crashes in Microsoft.Build and has nothing to do with docfx or wrong pathes. Maybe it would help to upgrade the packages, but I know, the dependencies, new conflicts etc. Maybe it’s because I also have the latest VS2022 preview installed for .NET7 development. But before this was never a problem together with docfx, it started after the last official VS2022 community update. I’ll do some more debugging, if I find a solution I will let you know.

image

image