FSharp.Formatting icon indicating copy to clipboard operation
FSharp.Formatting copied to clipboard

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

Open ArtemyB opened this issue 4 years ago • 2 comments

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: https://github.com/ArtemyB/FsDocsSample/issues/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).

ArtemyB avatar Jun 06 '21 12:06 ArtemyB

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...

jwosty avatar Jan 02 '23 00:01 jwosty

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.

nojaf avatar Jan 02 '23 07:01 nojaf