【问题标题】:NuGet Framework Assemblies not workingNuGet 框架程序集不起作用
【发布时间】:2011-05-01 10:06:29
【问题描述】:

我正在尝试更新 nuget 包以添加一些程序集引用,但出现以下错误:

命名空间“http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd”中的元素“元数据”在命名空间http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd'中具有无效的子元素“frameworkAssemblies”。预期的可能元素列表:命名空间“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>

【问题讨论】:

    标签: .net nuget nuspec


    【解决方案1】:

    我认为您的 nuget.exe 版本已过时。您可以简单地运行“nuget update”,它会自行更新到最新版本(截至今天为 1.3.20425.372)。然后你的 nuspec 应该可以正常工作了!

    【讨论】:

    • 感谢大卫,这很有效。奇怪的是我实际上卸载了 nuget 并安装了 1.3。 VS 扩展管理器显示的是 1.3,但命令行仍然是 1.2。
    • 实际上,nuget.exe 根本不附带 VS 扩展,因此您可能在某个时候从其他地方得到它。检查它的位置可能有助于记住它是如何到达那里的。
    【解决方案2】:

    如果您将元素放置在错误的位置,也会出现此错误。
    例如您将&lt;dependencies&gt; 元素放在&lt;metadata&gt; 元素之外。

    【讨论】:

      【解决方案3】:

      我在安装/卸载 VS11 Beta 后也遇​​到了这个问题。

      its codeplex project page 重新安装 nuget 很快就为我解决了这个问题。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2020-06-23
        • 1970-01-01
        • 2022-01-14
        • 2010-10-13
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多