19

いくつかのアセンブリ参照を追加するために nuget パッケージを更新しようとしていますが、次のエラーが発生します。

名前空間 ' http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd 'の要素 'metadata' には、名前空間http://schemas.microsoft.com/packaging/2010に無効な子要素 'frameworkAssemblies' があります/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>
4

3 に答える 3

20

nuget.exe のバージョンが古いと思います。「nuget update」を実行するだけで、最新の状態に更新されます (今日の時点では 1.3.20425.372)。その後、nuspec は正常に動作するはずです。

于 2011-05-01T20:37:53.263 に答える
4

要素を間違った場所に配置した場合にも、このエラーが発生する可能性があります。
例:<dependencies>要素の外側に要素を配置し<metadata>ます。

于 2016-12-13T14:27:56.187 に答える
2

VS11 Betaをインストール/アンインストールした後もこれにぶつかりました。

コードプレックス プロジェクト ページから nuget を再インストールすると、問題がすぐに解決されました。

于 2012-04-11T21:02:41.717 に答える