[英]Nuget fails to include files listed in the nuspec file when paths contain certain msbuild properties
I'm trying to create a nuget package using certain MSbuild properties for the path to a file I want in my nuget package. 我正在尝试使用某些MSbuild属性为nuget包中想要的文件的路径创建nuget包。 However, if I use certain MSbuild pre-defined properties in the path, nuget fails to include them in the package (but does not throw any errors).
但是,如果我在路径中使用某些MSbuild预定义属性,则nuget无法将它们包括在包中(但不会引发任何错误)。
In my .nuspec, I have something that looks like this: 在我的.nuspec中,我看起来像这样:
<files>
<file src="$MSBuildProjectDirectory$\..\..\Setup\CommonWebScripts\CreateIISSite.ps1" target=".\"/>
</files>
I can verify that the substitution is working because if I change the path to have an non-existent folder in it, nuget throws an error saying that the path is invalid. 我可以验证替换是否正常工作,因为如果我更改路径以在其中存在不存在的文件夹,则nuget会引发错误,指出该路径无效。 Similarly, if I hardcode the path to the file without using the MSbuild property, the package will be created with the file included.
同样,如果我在不使用MSbuild属性的情况下对文件的路径进行硬编码,则将使用包含的文件来创建程序包。
I've tried using nuget 2.8.1 and 2.8.2, but it seems to be broken either way. 我已经尝试使用nuget 2.8.1和2.8.2,但是它似乎都被破坏了。
Turns out this was a bug in nuget code, which was fixed after I posted the problem on codeplex. 原来这是nuget代码中的错误,当我在Codeplex上发布问题后,该错误已得到修复。 Link to the issue on codeplex: https://nuget.codeplex.com/workitem/4153
链接到Codeplex上的问题: https ://nuget.codeplex.com/workitem/4153
Updating nuget should fix the issue. 更新nuget应该可以解决此问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.