19

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>
Drew Noakes
  • 300,895
  • 165
  • 679
  • 742
Brad Robinson
  • 44,114
  • 19
  • 59
  • 88

3 Answers3

21

I think you have an outdated version of nuget.exe. You can simply run 'nuget update' and it will update itself to the latest (which as of today is 1.3.20425.372). Your nuspec should then work fine!

David Ebbo
  • 42,443
  • 8
  • 103
  • 117
  • Thanks David, that worked. Weird cause I actually uninstalled nuget and installed 1.3. VS extension manager was showing 1.3, but command line was still 1.2. – Brad Robinson May 01 '11 at 21:34
  • Actually, nuget.exe doesn't come with the VS extension at all, so you probably got it from elsewhere at some point. Checking its location might help remember how it got there. – David Ebbo May 02 '11 at 04:12
4

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.

Ralph Willgoss
  • 11,750
  • 4
  • 64
  • 67
2

I hit this too after installing/uninstalling VS11 Beta.

Reinstalling nuget from its codeplex project page sorted the issue out for me quite quickly.

Drew Noakes
  • 300,895
  • 165
  • 679
  • 742