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

Hard-to-diagnose "No metadata is generated" error when code has no namespace #165

Closed
jskeet opened this issue Feb 18, 2016 · 2 comments
Closed
Labels
bug A bug to fix

Comments

@jskeet
Copy link

jskeet commented Feb 18, 2016

Title

Hard-to-diagnose "No metadata is generated" error when code has no namespace

Functional impact

Friction when trying to reproduce a trivial issue, or when getting started from scratch for tiny simple demo purposes.

Minimal repro steps

Step 1. Create a project.json file of:

{
  "version": "1.0.0",
  "frameworks": {
      "net451": { }
  }
}

Step 2. Create a DocfxTest.cs file of:

/// <summary>Just a demo</summary>
public class DocfxTest
{
}

Step 3. Ensure it builds:

dnu restore
dnu build

Step 4. Create a docfx.json file of:

{
  "metadata": [
    {
      "src": [
        {
          "files": [ "project.json" ],
          "cwd": "."
        }
      ],
      "dest": "obj/api"
    }
  ],
  "build": {
    "content": [
      {
        "files": [ "**/*.yml" ],
        "cwd": "obj/api",
        "dest": "api"
      }],
    "dest": "_site"
  }
}

Step 5. Try to generate the metadata:

docfx metadata

Expected result

Metadata should be generated, or if this restriction is deliberate, it should give a more detailed warning.

Actual result

Result from step 5:

Info: Config file docfx.json found, start generating metadata...
Warning: No metadata is generated for docfxbug2.


Build succeeded with warning.
Warning: No metadata is generated for docfxbug2.


There are totally 1 Warning(s), 0 Error(s)

Further technical details

On the off-chance, I added a namespace to the code in step 2. Regenerate the metadata (with -f) and bingo - it all works.

I can now submit the bug I was actually trying to reproduce to start with...

@vicancy vicancy added the bug A bug to fix label Feb 18, 2016
vicancy added a commit that referenced this issue Feb 22, 2016
@vicancy vicancy closed this as completed Feb 22, 2016
@jskeet
Copy link
Author

jskeet commented Feb 22, 2016

Great - thanks for the swift resolution :)

@matkoch
Copy link

matkoch commented May 23, 2017

First part of this problem is still actual.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug to fix
Projects
None yet
Development

No branches or pull requests

3 participants