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

Created on 18 Apr 2017  路  36Comments  路  Source: dotnet/docfx

_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

bug

Most helpful comment

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?

All 36 comments

@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?

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

Please find below the json file.

docfx.zip

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?

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

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

image

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

I do run Visual Studio with its latest release:
image

and enclosed the output of a diagnostic build

build.txt

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

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

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?

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!

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

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.

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

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

@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 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 make sure it is a clean install instead of an update

@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 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 the import line was not available in my project file so I added it. Still doesn't work. So I think the source of my problem is somewhere else. I checke nuget once again and found that there is no version 2.16.5 but only 2.16.2 available and this version is still missing the build folder. Where can I get version 2.16.5?

My fault, I am using myget feed... I pushed the latest bits to nuget, try now.

@vicancy now I got version 2.16.5 but it is still missing the build folder so still not working
image

@vicancy thanks for taking a look - I struggled to understand how best to migrate my 2.15 json file to 2.16 and thought I'd tried it like that!

I have made the suggested change and my project now builds with the rezolver.csproj project; and it's all working again. That's using 2.16.2 as well (I thought I'd try the latest nuget build rather than download the latest binary release).

Many many thanks for your help!

@vicancy I got 2.16.5 but it sill has no build directory in the package.
image

Isn't this directory needed to make the build work from within Visual Studio 2017?

@ThomasEnioKohler let me check. The build directory should be in the package. However there is another build that overwrites the correct package...

@ThomasEnioKohler there is a mysterious bug in .ps script that it occasionally left out the 'build' folder as it contains only one file. Haven't found the root cause yet... Will let you know when 2.16.6 is published.

@vicancy I just found that the target file was copied to the tools directory. So I copied it into the build folder and rebuilt the documentation. Now I get the following error:
Build failed.
1> [17-04-25 01:59:40.370]Error:System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
1> at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
1> at System.Reflection.RuntimeAssembly.get_DefinedTypes()
1> at System.Composition.Hosting.ContainerConfiguration.b__0(Assembly a)
1> at System.Linq.Enumerable.d__162.MoveNext() 1> at System.Composition.TypedParts.TypedPartExportDescriptorProvider..ctor(IEnumerable1 types, AttributedModelProvider attributeContext)
1> at System.Composition.Hosting.ContainerConfiguration.CreateContainer()
1> at Microsoft.DocAsCode.Dfm.DfmEngineBuilder..ctor(Options options, String baseDir, String templateDir, IReadOnlyList1 fallbackFolders) 1> at Microsoft.DocAsCode.Dfm.DocfxFlavoredMarked.CreateBuilder(String baseDir, String templateDir, Options options, IReadOnlyList1 fallbackFolders)
1> at Microsoft.DocAsCode.Build.Engine.DfmLegacyServiceProvider.DfmService..ctor(String baseDir, String templateDir, ImmutableDictionary2 tokens, IEnumerable1 tokenTreeValidator, IReadOnlyList1 fallbackFolders) 1> at Microsoft.DocAsCode.Build.Engine.DfmLegacyServiceProvider.CreateMarkdownService(MarkdownServiceParameters parameters) 1> at Microsoft.DocAsCode.Build.Engine.SingleDocumentBuilder.BuildCore(DocumentBuildParameters parameters) 1> at Microsoft.DocAsCode.Build.Engine.DocumentBuilder.BuildCore(DocumentBuildParameters parameter, IMarkdownServiceProvider markdownServiceProvider) 1> at Microsoft.DocAsCode.Build.Engine.DocumentBuilder.Build(IList1 parameters, String outputDirectory)
1> at Microsoft.DocAsCode.SubCommands.DocumentBuilderWrapper.BuildDocument(BuildJsonConfig config, TemplateManager templateManager, String baseDirectory, String outputDirectory, String pluginDirectory, String templateDirectory)
1> at Microsoft.DocAsCode.SubCommands.BuildCommand.BuildDocument(String baseDirectory, String outputDirectory)
1> at Microsoft.DocAsCode.SubCommands.BuildCommand.Exec(SubCommandRunningContext context)
1> at Microsoft.DocAsCode.SubCommands.CompositeCommand.Exec(SubCommandRunningContext context)
1> at Microsoft.DocAsCode.Program.ExecSubCommand(String[] args)
1> 0 Warning(s)
1> 1 Error(s)
1>C:\Users\Thomas.nuget\packages\docfx.console\2.16.5build\docfx.console.targets(52,5): error MSB3073: The command ""C:\Users\Thomas.nuget\packages\docfx.console\2.16.5build..tools\docfx.exe" "W:\Net\enio.LockScreenTimer\enio.LockScreenTimer.Documentation/docfx.json" -o "" -l "log.txt" --logLevel "Verbose" -f" exited with code 1.

Any idea?

Oh, this looks like the same issue I talk about here: https://github.com/dotnet/docfx/issues/925, you can try my hack if you want (adding where !assembly.GetName().FullName.Contains("Microsoft.NuGet.Build.Tasks") to the linq query in DfmEngineBuilder.GetContainer).

Hi @ThomasEnioKohler try the latest one 2.16.7 https://www.nuget.org/packages/docfx.console/

@vicancy Now it builds again. Thank you. The only problem though is that I still get the error written above. Regarding to the post of @tzachshabtay it needs a code change. Could you have a look at this as well?

I've upgraded to the latest version (2.16.7) and everything is now working as expected. Thanks.

The latest version works for me too without that code change (with one caveat: I now need to go to http://localhost:8080/_site instead of http://localhost:8080 to see my site locally).

@ThomasEnioKohler however Microsoft.NuGet.Build.Tasks.dll is not expected to be in the bin path for docfx... could you use FUSLOGVW.exe and provide the Assembly Binding Log https://msdn.microsoft.com/en-us/library/e74a18c4(v=vs.110).aspx?

@vicancy There were the following binding errors:

Microsoft.Build.resources, Version=15.1.0.0, Culture=en, PublicKeyToken=b03f5f7f11d50a3a.HTM (2 hits)
Line 5: Bind result: hr = 0x80070002. The system cannot find the file specified.
Line 37: Bind result: hr = 0x80070002. The system cannot find the file specified.

Microsoft.Build.resources, Version=15.1.0.0, Culture=en-US, PublicKeyToken=b03f5f7f11d50a3a.HTM (2 hits)
Line 5: Bind result: hr = 0x80070002. The system cannot find the file specified.
Line 37: Bind result: hr = 0x80070002. The system cannot find the file specified.

Microsoft.Build.Utilities.Core, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.HTM (3 hits)
Line 5: Bind result: hr = 0x80070002. The system cannot find the file specified.
Line 48: Bind result: hr = 0x80070002. The system cannot find the file specified.
Line 91: Bind result: hr = 0x80070002. The system cannot find the file specified.

Microsoft.CodeAnalysis.Workspaces.Desktop.resources, Version=2.0.0.0, Culture=en, PublicKeyToken=31bf3856ad364e35.HTM (2 hits)
Line 5: Bind result: hr = 0x80070002. The system cannot find the file specified.
Line 37: Bind result: hr = 0x80070002. The system cannot find the file specified.

Microsoft.CodeAnalysis.Workspaces.Desktop.resources, Version=2.0.0.0, Culture=en-US, PublicKeyToken=31bf3856ad364e35.HTM (2 hits)
Line 5: Bind result: hr = 0x80070002. The system cannot find the file specified.
Line 37: Bind result: hr = 0x80070002. The system cannot find the file specified.

Thanks @ThomasEnioKohler I am closing this issue as it is fixed and using #925 to track the TypeLoadException issue.

Was this page helpful?
0 / 5 - 0 ratings