【发布时间】:2016-01-25 15:51:48
【问题描述】:
我正在使用 Visual Studio 2013 中的在线“NuGet Packager”模板构建 NuGet 包。我的项目中有以下文件结构:
content/
docs/
|
+- Install.md
|
+- Install.html
lib/
src/
tools/
作为参考,我安装了 Visual Studio 的 Web Essentials 扩展,docs/Install.md 文件在保存时从 Markdown 编译为 HTML。
使用包含文件的默认 Package.nuspec 设置,docs 目录被复制到 .nupkg 文件的 content 目录。
Package.nuspec 的 <files> 部分:
<files>
<file src="lib\" target="lib" />
<file src="tools\" target="tools" />
<file src="docs\*" target="lib\docs" exclude="docs\**\*.md" />
<file src="content\" target="content" />
</files>
.nupkg 文件的结果文件结构:
content/
docs/
Install.html <-- This is NOT correct
lib/
docs/
Install.html <-- This is correct
package/
tools/
我的 <files> 规范的一些额外变体不起作用:
<file src="content\" target="content" exclude="docs" />
<file src="content\" target="content" exclude="docs\*" />
<file src="content\" target="content" exclude="docs\**\*" />
<file src="content\" target="content" exclude="content\docs" />
<file src="content\" target="content" exclude="content\docs\" />
<file src="content\" target="content" exclude="content\docs\*" />
<file src="content\" target="content" exclude="content\docs\**\*" />
如果我将 docs 文件夹排除在我的 Visual Studio 项目中,则此文件夹不再显示在生成的 content 文件夹中,而是像我想要的那样被复制到 lib 文件夹,但这破坏了保存.md 文件并让 Web Essentials 在保存时将其转换为 HTML。
为什么我的lib/docs 文件夹被复制到.nupkg 文件中的content 文件夹中?
【问题讨论】:
标签: visual-studio-2013 nuget nuget-package