1

Resolved

Namespace for reading nuspec file not up-to-date

description

The code that reads out the nuspec files uses a hardcoded xmlnamespace with the URL: http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd.
When I create nuspec files with nuget, they get the namespace url: http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd.
 
Trying to use the nugetter code with the new nuspec files result in 'cannot find element ns:/package/ns:metadat/ns:version..' errors.
I dont know how many times the xsd url changes, but it would be preferable to be able to alter the namespace url in the build proces settings. Now you have to alter the sourcecode of nugetter to make this work.
 
<MSN 9/8/11>
Initial testing with version 1.5.20830.9001 and 1.5.20905.5 created nuspec files with no namespace.  Not sure why. All examples refer to the 2010/07 version.
There is no available documentation on the current namespace in nuget.org or nuget.codeplex.com.
 
Found the schema namespaces in the source code: ManifestSchemaUtility.cs
        public const string SchemaVersionV1 = "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd";
        public const string SchemaVersionV2 = "http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd";
       
Going to add additional XML object that can handle multiple namespace options.
 
<MSN 9/9/11>
Modified the XmlGetElement object so that it is not reliant upon the namespace designator.  Since the NuGet.exe v1.5 command-line app does not provide the namespace it was determined that limiting to a particular namespace or set of namespaces is not necessary.  This is not only a fix for the current set of known namespaces but also means that future namespace changes will not effect NuGetter's ability to access elements within the NuSpec file.

comments

chrisism wrote Sep 8, 2011 at 6:31 PM

Further details:
Nuget.exe delivers nuspec files without namespace.
Nuget Package tool (GUI), option export delivers nuspec files with the 2011 namespace

marknic wrote Sep 9, 2011 at 12:31 AM

Thanks chrisism. I hadn't tried the GUI package tool and was only seeing the nuspec files without namespaces.

In any event, I already modified the code (locally) to work with both namespaces as well as no namespace. So, any combination will work. It will be released following some verification tests.