Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NuGet Framework Assemblies not working

Tags:

.net

nuget

nuspec

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>
like image 287
Brad Robinson Avatar asked May 01 '11 10:05

Brad Robinson


3 Answers

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!

like image 103
David Ebbo Avatar answered Nov 02 '22 23:11

David Ebbo


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.

like image 34
Ralph Willgoss Avatar answered Nov 03 '22 00:11

Ralph Willgoss


I hit this too after installing/uninstalling VS11 Beta.

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

like image 2
Drew Noakes Avatar answered Nov 03 '22 00:11

Drew Noakes