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' doesn't find TargetPath for projects using TargetFrameworks multi-targeting #551

Open
dsyme opened this issue Jul 21, 2020 · 1 comment

Comments

@dsyme
Copy link
Contributor

dsyme commented Jul 21, 2020

@Krzysztof-Cieslak This is a bug related to the tool's use of dotnet-proj-info - you might know the answer or where to look?

Basically of a project file uses

 <TargetFrameworks>...</TargetFrameworks>

then the project cracking logic used by fsdocs build doesn't find TargetPath for the default target framework.

You currently have to switch to a single TargetFramework

 <TargetFramework>...</TargetFramework>

(We get an error like this if anyone is searching for this)

Error :
System.ArgumentNullException: Value cannot be null. (Parameter 'path')
   at System.IO.Path.GetFullPath(String path)
   at <StartupCode$FSharp-Formatting-ApiDocs>.$GenerateModel.libDirs@1573.Invoke(String arg00) in E:\GitHub\dsyme\FSharp.Formatting\src\FSharp.Formatting.ApiDocs\GenerateModel.fs:line 1573
   at Microsoft.FSharp.Primitives.Basics.List.map[T,TResult](FSharpFunc`2 mapping, FSharpList`1 x) in E:\A\_work\130\s\src\fsharp\FSharp.Core\local.fs:line 250
   at Microsoft.FSharp.Collections.ListModule.Map[T,TResult](FSharpFunc`2 mapping, FSharpList`1 list) in E:\A\_work\130\s\src\fsharp\FSharp.Core\list.fs:line 76
   at FSharp.Formatting.ApiDocs.ApiDocsModel.Generate(IEnumerable`1 dllFiles, FSharpOption`1 parameters, FSharpOption`1 xmlFile, FSharpOption`1 sourceRepo, FSharpOption`1 sourceFolder, FSharpOption`1 publicOnly, FSharpOption`1 libDirs, FSharpOption`1 otherFlags, FSharpOption`1 mdcomments, FSharpOption`1 urlRangeHighlight, String rootUrl) in E:\GitHub\dsyme\FSharp.Formatting\src\FSharp.Formatting.ApiDocs\GenerateModel.fs:line 1573

In theory I guess we could also build API docs for each of the targets but I don't think it will be needed much, the default will do.

@kurtschelfthout
Copy link
Contributor

Same issue, nicer error with latest version:

> dotnet fsdocs build --projects .\src\FsCheck\FsCheck.fsproj
cracking projects...
  skipping project 'FsCheck.fsproj' because it doesn't have a target path
Error while cracking project files, no project files succeeded, exiting.

Removing TargetFrameworks solves it.

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

2 participants