Nuget添加库包引用错误
在我的一个项目中,我在尝试添加某些 nuget 包时开始出现错误。任何 jQuery.ui 包、SassAndCoffee、Knockout.js,甚至 Unity。错误是:
<代码> 安装失败。回滚... 元素“http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd:authors”不能包含子元素“http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd:作者',因为父元素的内容模型只是文本。
我创建了一个空项目,这些都安装得很好。有什么想法吗?
On one of my projects I have started getting errors while attempting to add certain nuget packages. Any of the jQuery.ui packages, SassAndCoffee, Knockout.js, even Unity. The error is:
Install failed. Rolling back...
The element 'http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd:authors' cannot contain child element 'http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd:author' because the parent element's content model is text only.
I have created an empty project and these all install fine. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的猜测是,您使用旧版本的 Nuget 创建了项目,然后在向项目添加一些包后升级了 Nuget。较新版本的 Nuget 没有将作者作为authors 元素的子元素,而是以逗号分隔的字符串列表。
在这种情况下,解决方案是删除软件包并从packages.config 中手动编辑它们。
请参阅此问题以获取解释和解决方案。
My guess is that you have created the project with an older version of Nuget and then upgraded Nuget after adding some packages to the project. The newer versions of Nuget don't have the authors as child elements of the authors element, it's instead a comma separated list of strings.
In that case the resolution would be to delete the packages and manually edit them out from the packages.config.
See this issue for explanation and resolution.