开发者

NuGet Framework Assemblies not working

开发者 https://www.devze.com 2023-03-02 02:30 出处:网络
I\'m trying to update a nuget package to add some assembly references, but I\'m getting the following error:

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 POC开发者_开发百科O 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 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!


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.


I hit this too after installing/uninstalling VS11 Beta.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号