David S.
David S.

Reputation: 6105

NuGet Package'n'Publish project include xml comments

I have this structure in my solution:

Solution
    project: class library
    project: NuGet.Package'n'Publish

I need to include the xml comments file generated by the class library project in the NuGet package. I have seen other answers suggesting to add <file src="bin\*.xml" target="lib" /> or some variant in the nuspec file, but I can't get it to work.

The class library does generate an xml file, but it isn't included in the package.

I don't even know where to begin troubleshooting other than trying random variants of the <file... tag, which hasn't worked this far.

There is no error message - it just isn't included.

The default section in the NuGet.Package'n'Publish project's nuspec template looks like this:

<files>
  <file src="lib\**\*.dll" target="lib" />
  <file src="lib\**\*.pdb" target="lib" />
  <file src="tools\**\*.*" target="tools" />
  <file src="content\**\*.*" target="content" exclude="content\Content.Readme.txt" />
</files>

Upvotes: 0

Views: 977

Answers (1)

bhuvak MSFT
bhuvak MSFT

Reputation: 361

Not sure how the NugetPackageNPublish Extension works. But trying to package it using Nuget.exe Pack command works fine me. More details around Nuget command line can be found here @ http://docs.nuget.org/docs/reference/command-line-reference

Is there any scenario where Nuget.exe pack would not serve your purpose ?

Upvotes: 1

Related Questions