docfx icon indicating copy to clipboard operation
docfx copied to clipboard

_site folder is not generated at all after updating docfx.console package from 2.15.5 to 2.16.0

Open ThomasEnioKohler opened this issue 9 years ago • 36 comments

_site folder is not created

After updating from 2.15.6 to 2.16.0 with no change in project or project structure the _site folder is not generated anymore.

Functional impact

no generation of the _site folder and therefore no web site available

Minimal repro steps

Update nuget package from version 2.15.6 to 2.16.0

Expected result

_site folder has to be generated on build

Actual result

It seems that docfx doesn't run at all on build

Further technical details

none

ThomasEnioKohler avatar Apr 18 '17 12:04 ThomasEnioKohler

@ThomasEnioKohler I tried to run docfx 2.16.0 against docfx-seed, and I can see the _site folder, could you share your docfx.json with us? Did you include "dest": "_site" in it?

hellosnow avatar Apr 18 '17 13:04 hellosnow

I did use the default docfx.json file generated when the docfx.console package was added.

Please find below the json file.

docfx.zip

ThomasEnioKohler avatar Apr 18 '17 13:04 ThomasEnioKohler

2.16 upgrades to use net46. Visual Studio 2017 with .NET Core cross-platform development toolset is a prerequisite, @ThomasEnioKohler what is your running env?

vicancy avatar Apr 19 '17 02:04 vicancy

could you run with --loglevel verbose and provide the log?

vicancy avatar Apr 19 '17 02:04 vicancy

I run Visual Studio 2017 with .Net Core development toolset installed.

image

How can I run with --loglevel verbose when building from Visual Studio?

ThomasEnioKohler avatar Apr 19 '17 06:04 ThomasEnioKohler

I do run Visual Studio with its latest release: image

ThomasEnioKohler avatar Apr 19 '17 06:04 ThomasEnioKohler

and enclosed the output of a diagnostic build

build.txt

ThomasEnioKohler avatar Apr 19 '17 06:04 ThomasEnioKohler

Try running in command line: C:\NuGetPackages\docfx.console.2.16.0\tools\docfx.exe docfx.json --loglevel verbose

vicancy avatar Apr 19 '17 07:04 vicancy

running with the command line the _site is generated properly. it doesn't work from Visual Studio only

ThomasEnioKohler avatar Apr 19 '17 08:04 ThomasEnioKohler

We are experiencing exactly the same issue. We noticed that the "build" folder is missing from the 2.16.2 nuGet package which would explain why the site is not being generated. Is there an issue with the package or do we need to do something else to get this to work?

justhoma-zz avatar Apr 20 '17 16:04 justhoma-zz

I had an issue upgrading from 2.15 to 2.16 whereby the .targets imports in the .csproj file were removed but not re-added. I re-added this import into the project file but noticed, whilst manually adding it, that the new imports looks like this:

<Import Project="..\..\packages\docfx.console.2.16.2\tools\docfx.console.targets" Condition="Exists('..\..\packages\docfx.console.2.16.2\tools\docfx.console.targets')" />

Whereas it previously looked like this:

<Import Project="..\..\packages\docfx.console.2.x.y\build\docfx.console.targets" Condition="Exists('..\..\packages\docfx.console.2.x.y\build\docfx.console.targets')" />

Where x and y were the previous version numbers. But the main different is that all this build-time content has been moved from build\ to tools\

I now have it running again on build - but it's not generating any metadata for my project, Rezolver.

Here is the docfx.json, altered according to the 2.16.x release doc; and here is the project file it's pointing at.

And, right at the beginning of the log output from the docfx command line - I see this:

3>  [17-04-20 10:53:19.753]Warning:Cache for E:/Github/Rezolver/src/Rezolver/Rezolver.csproj in E:\Github\Rezolver\src\Rezolver\obj\xdoc\cache\final\1285379993 is corrupted
3>  [17-04-20 10:53:19.753]Warning:No metadata is generated for Rezolver.

If I clean the E:\Github\Rezolver\src\Rezolver\obj\xdoc\cache folder and rebuild, I no longer get a message about corruption - but I still get a message telling me that no metadata is generated.

I have been using a dummy .csproj file (called rezolver-docfx.csproj - but it doesn't auto-link MSDN types (like System.Linq.Expressions.Expression) via the xref maps for any <see cref="blah" XMLDoc comments. And, in any case, that no longer works either because I get a TypeLoadException logged by docfx after doing a build!

LordZoltan avatar Apr 20 '17 23:04 LordZoltan

Looks like a bug in packaging msbuild.console package, will take a look. Thanks for reporting the issue

vicancy avatar Apr 21 '17 08:04 vicancy

As mentioned at the end of my last comment, when trying to use a 'standard' csproj as the reference project in the docfx.json file (as I did before after moving to project.json to the new msbuild format), I get a TypeLoadException - here's the build log I get which contains the full stacktrace at the end.

LordZoltan avatar Apr 21 '17 10:04 LordZoltan

I am also having same issue with 2.16.2 version - no _site folder created.

viraln25 avatar Apr 24 '17 11:04 viraln25

@ThomasEnioKohler @viraln25 v2.16.5 should work, please have a try #1587

vicancy avatar Apr 25 '17 05:04 vicancy

@LordZoltan rezolver-docfx.csproj is no longer needed, 2.16+ supports the latest csproj. For the TypeLoadException, which version is your docfx? Is it possible that there are multiple version of docfx? Looks like your docfx.json put properties in a wrong place... Yours:

"metadata": [
    {
      "src": [
        {
          "files": [
            "rezolver.csproj"
          ],
          "cwd": "../../src/Rezolver",
          "properties": {
            "TargetFramework": "net46"
          }
        }
      ],
      "dest": "_docfx_proj/obj/api"
    }
  ]

Should be:

"metadata": [
    {
      "src": [
        {
          "files": [
            "rezolver.csproj"
          ],
          "cwd": "../../src/Rezolver"
        }
      ],
      "dest": "_docfx_proj/obj/api",
      "properties": {
          "TargetFramework": "net46"
      }
    }
  ]

vicancy avatar Apr 25 '17 06:04 vicancy

@vicancy I just gave it a try but it still doesn't work. Do I need to do any changes in my configuration because 2.15.5 still works perfect.

ThomasEnioKohler avatar Apr 25 '17 06:04 ThomasEnioKohler

@ThomasEnioKohler make sure it is a clean install instead of an update

vicancy avatar Apr 25 '17 06:04 vicancy

@vicancy if you mean deinstalling the nuget package and then reinstall this is what I did and it doesn't work. Or do you have another understanding of a clean install?

ThomasEnioKohler avatar Apr 25 '17 06:04 ThomasEnioKohler

@ThomasEnioKohler Could you check if your .csproj contains such line: <Import Project="..\packages\docfx.console.2.16.5\build\docfx.console.targets" Condition="Exists('..\packages\docfx.console.2.16.5\build\docfx.console.targets')" /> ?

vicancy avatar Apr 25 '17 06:04 vicancy