NuGet 框架程序集不工作
我正在尝试更新 nuget 包以添加一些程序集引用,但出现以下错误:
命名空间“http://schemas.microsoft”中的元素“元数据”。 com/packaging/2010/07/nuspec.xsd' 在命名空间 http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd'。预期可能的元素列表:命名空间“http://”中的“依赖项、语言、摘要” /schemas.microsoft.com/packaging/2010/07/nuspec.xsd'
我相信此功能是在 NuGet 1.2 中添加的 - 我正在使用1.2.2213.45。
这是我的 nuspec 文件:
<?xml version="1.0"?>
<package xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<id>PetaPoco.Core</id>
<title>PetaPoco.Core - A tiny ORMish thing for your POCOs (Core Only)</title>
<version>3.0.0</version>
<authors>Topten Software</authors>
<owners>Topten Software</owners>
<licenseUrl>http://www.toptensoftware.com/petapoco/license</licenseUrl>
<projectUrl>http://www.toptensoftware.com/petapoco/</projectUrl>
<iconUrl>http://www.toptensoftware.com/petapoco/nuget_icon.png</iconUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>
PetaPoco is a tiny, single file .NET data access layer inspired by Massive that works with both non-dynamic POCO objects and dynamics.
This package includes the just the core PetaPoco library (ie: no T4 templates)
</description>
<tags>ORM POCO MVC MVC2 MVC3 ASP.NET WebForms WebMatrix MySQL Database</tags>
<frameworkAssemblies>
<frameworkAssembly assemblyName="System.Data" />
<frameworkAssembly assemblyName="System.Configuration" />
</frameworkAssemblies>
</metadata>
<files>
<file src="PetaPoco.cs" target="Content\Models" />
</files>
</package>
I'm trying to update a nuget package to add some assembly references, but I'm getting the following error:
The element 'metadata' in namespace 'http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd' has invalid child element 'frameworkAssemblies' in namespace http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd'. List of possible elements expected: 'dependencies, language, summary' in namespace 'http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd'
I believe this functionality was added in NuGet 1.2 - I'm using 1.2.2213.45.
Here's my nuspec file:
<?xml version="1.0"?>
<package xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<id>PetaPoco.Core</id>
<title>PetaPoco.Core - A tiny ORMish thing for your POCOs (Core Only)</title>
<version>3.0.0</version>
<authors>Topten Software</authors>
<owners>Topten Software</owners>
<licenseUrl>http://www.toptensoftware.com/petapoco/license</licenseUrl>
<projectUrl>http://www.toptensoftware.com/petapoco/</projectUrl>
<iconUrl>http://www.toptensoftware.com/petapoco/nuget_icon.png</iconUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>
PetaPoco is a tiny, single file .NET data access layer inspired by Massive that works with both non-dynamic POCO objects and dynamics.
This package includes the just the core PetaPoco library (ie: no T4 templates)
</description>
<tags>ORM POCO MVC MVC2 MVC3 ASP.NET WebForms WebMatrix MySQL Database</tags>
<frameworkAssemblies>
<frameworkAssembly assemblyName="System.Data" />
<frameworkAssembly assemblyName="System.Configuration" />
</frameworkAssemblies>
</metadata>
<files>
<file src="PetaPoco.cs" target="Content\Models" />
</files>
</package>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我在安装/卸载 VS11 Beta 后也遇到了这个问题。
从 其 codeplex 项目页面重新安装 nuget 很快就解决了这个问题。
I hit this too after installing/uninstalling VS11 Beta.
Reinstalling nuget from its codeplex project page sorted the issue out for me quite quickly.
我认为您的
nuget.exe
版本已过时。您只需运行nuget update
即可,它会自行更新到最新版本(截至今天为 1.3.20425.372)。然后您的.nuspec
应该可以正常工作!I think you have an outdated version of
nuget.exe
. You can simply runnuget update
and it will update itself to the latest (which as of today is 1.3.20425.372). Your.nuspec
should then work fine!如果您将元素放置在错误的位置,您也可能会收到此错误。
例如,您将
元素放置在
元素之外。You can also get this error if you have placed an element in the wrong place.
e.g. You place the
<dependencies>
elements, outside of the<metadata>
element.