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

fsdocs build fails while cracking projects that have dependencies on another projects #680

Open
ArtemyB opened this issue Jun 6, 2021 · 2 comments

Comments

@ArtemyB
Copy link

ArtemyB commented Jun 6, 2021

Tried to use fsdocs (v11.2.0) to generates docs only for solution with multiple projects that has dependencies on each other. But the tool successfully generates API reference only for the project (in solution) that has no dependencies and fails on other projects which have references to other *.fsproj. Final Error log entry from fsdocs looks not very helpful:

log -
   at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1433.Invoke(String message) in D:\workspace\_work\1\s\src\fsharp\FSharp.Core\printf.fs:line 1433
   at [email protected](String p) in /home/runner/work/FSharp.Formatting/FSharp.Formatting/src/FSharp.Formatting.CommandTool/ProjectCracker.fs:line 321

I've created a simple demo solution which demonstrates the problem: https://github.com/ArtemyB/FsDocsSample. The solution consists of 2 .NET Standard library projects: the 1st one has no dependencies (fsdocs successfully generates API reference for it) and the 2nd has dependency on the 1st (fsdocs does not generate API reference for it).

Full fsdocs console output can bee viewed there: ArtemyB/FsDocsSample#1

I've also tested an earlier fsdocs version (v9.0.1) that doesn't use Ionide.ProjInfo for project cracking and it handles projects with dependencies successfully (however it fails on projects with third-party dependencies due to #616).

rdipardo added a commit to rdipardo/Fornax.Seo that referenced this issue Jul 6, 2021
Mitigates a suspected regression in the way MSBuild 16.10 handles
project references:

    fsprojects/FSharp.Formatting#680
@jwosty
Copy link

jwosty commented Jan 2, 2023

Running into this problem, and can't use the downgrade workaround due to third party dependencies. Is there any solution to this?

Also worth noting that I can't update to the latest fsdocs tool because it requires dotnet 7 and I need to build my package for .net 6 since Fable doesn't support .net 7 yet. Getting a bit stuck here...

@nojaf
Copy link
Collaborator

nojaf commented Jan 2, 2023

Hello, you could try to pass in the missing reference as --fscoptions argument.
Example --fscoptions " -r:MyAssembly.dll" (mind the space after ", it is required to parse correctly).

We use this in Fantomas.
This works from 15.0.2 and higher.

Another option would be to start looking at Fable 4, it supports dotnet 7 these days. I've recently upgraded.

I hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants