【问题标题】:Nuget fails to include files listed in the nuspec file when paths contain certain msbuild properties当路径包含某些 msbuild 属性时,Nuget 无法包含 nuspec 文件中列出的文件
【发布时间】:2014-05-07 23:22:53
【问题描述】:

我正在尝试使用某些 MSbuild 属性创建一个 nuget 包,作为我的 nuget 包中我想要的文件的路径。但是,如果我在路径中使用某些 MSbuild 预定义属性,nuget 无法将它们包含在包中(但不会引发任何错误)。

在我的 .nuspec 中,我有这样的东西:

<files>
   <file src="$MSBuildProjectDirectory$\..\..\Setup\CommonWebScripts\CreateIISSite.ps1" target=".\"/>
</files>

我可以验证替换是否有效,因为如果我将路径更改为其中包含不存在的文件夹,nuget 会引发错误,指出路径无效。同样,如果我在不使用 MSbuild 属性的情况下硬编码文件的路径,则会创建包含该文件的包。

我尝试过使用 nuget 2.8.1 和 2.8.2,但它似乎都被破坏了。

【问题讨论】:

    标签: msbuild nuget nuget-package


    【解决方案1】:

    原来这是 nuget 代码中的一个错误,在我将问题发布到 codeplex 后已修复。链接到 codeplex 上的问题: https://nuget.codeplex.com/workitem/4153

    更新 nuget 应该可以解决问题。

    【讨论】:

      猜你喜欢
      • 2015-05-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-10-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多