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
docfx.console NuGet package does not work well with a class library with multiple items in <TargetFrameworks> #2284
Comments
I found that if I change the VS build settings to disable parallel builds I can get past the log.txt in use problem. However, there are still blocking issues. (The API YML files end up in an _Api folder despite having no mention of such a thing in the docfx.json file, so it gets warning that ti is unable to find the toc.yml or toc.md file and ends up with no docs in the final output...) (DOCFX just seems like an alpha release all around, and ironically has very little in the way of basic usage documentation) |
As an alternative to forcing single threaded builds I realized you can add the following property to your project: <PropertyGroup>
<LogFile>Docfx-$(TargetFramework).log</LogFile>
</PropertyGroup> This creates a unique log file name for each TargetFramework and therfore they don't collide. Still, a pretty If you don't disable the default inclusion "globs" then the log files wll become part of your project in VS so you may want to add the following as well: <ItemGroup>
<None Remove="Docfx-*.log" />
</ItemGroup> |
@smaillet the |
@lextm - I don't follow that version comment, I'm not building your sample, I'm using my own and I do see that toc warning and the _api folder being generated despite not having any such references. So, yes the warning is legit, however the tool shouldn't be getting into a state where that warning triggers. In your case you aren't doing a merge, in mine I am, following the comment on Github for handling multiple TargetFrameworks. That is supposed to generate a seperate set of YML files into two distinct temp locations and then merge the results of both into a single result set in the 'api' folder. But that's not at all what is happening |
One of my projects is currently hitting this issue. Is there a workaround for this or is this still awaiting a fix? |
What is the solution / work around here? |
As I found in the documentation, instead of:
Should be
|
Greetings all... I am investigating DocFX for https://github.com/ExtendedXmlSerializer/ExtendedXmlSerializer/issues/284 And right out of the gate I ran into this issue. This is my
Perhaps there is something obvious I am missing? I am still getting errors about locked
|
This seems to do the trick:
Not sure how that's going to work for updating to latest from Nuget, however. 🤷♂️ It would seem that for each Even after the logging hack that @smaillet provided, I was still getting lock exceptions on other files because of this. From this, it would seem that DocFX simply needs to make sure that this build has occurred once per entire build and not once per |
This is still an issue in version 2.58.8, please fix Setting up conditional item group works to an extent, but you need to manually update csproj file every time you update the nuget pkg |
Very annoying tat this is still not fixed to this date: 5 years later! |
The documentation reads:
This gives a hint that Docfx has troubles building docs for multi target projects right out of the box. SolutionThe only solution that solved my issue was to add the following condition to the particular .csproj project file, where, in this case, the default version is chosen to be <PropertyGroup>
<BuildDocFx Condition="$(TargetFramework) != 'net6.0-windows'">false</BuildDocFx>
</PropertyGroup> Docfx should add the |
The workaround described here works if the multitargeted library being documented has identical API surface for all targets. If not, it seems that the merge approach described above is required, however, that fails with a Null Reference. Is there really no way to use DocFx with multi-targeting libraries? Seems like such a basic thing to prioritize, but I may be missing the context the team uses for deciding on issue priorities. Would it be please possible to learn whether there is any hope for this to be addressed in the foreseeable future, or should we be looking for completely different solutions for the time being? |
@macrogreg If you read other threads, such as #7050, you should know that placing any hope on this project is not realistic. |
DocFX Version Used: 2.28.2
Template used:
default
Steps to Reproduce:
<TargetFrameworks>
tag to use multiple values likenetstandard1.3;net452
.docfx.console
NuGet package to this project.docfx.json
file to include the following information,Expected Behavior:
The documentation should be generated without any error.
Actual Behavior:
docfx seemed to be called twice, and the second instance could not access the log file and crashed,
The text was updated successfully, but these errors were encountered: