So both this:
NuGet.exe" pack ".\MyPackage.nuspec" -Version 1.0.1-alpha
and
<?xml version="1.0" encoding="utf-8"?>
<package>
<metadata>
<id>MyCoolPackage</id>
<version>1.0.1-alpha</version>
<authors>MyAuthors</authors>
<owners>MyOwner</owners>
<!-- <licenseUrl>http://www.yourLicenseUrl.com</licenseUrl> -->
<projectUrl>http://www.yourProjectUrl</projectUrl>
<iconUrl>http://www.yourIconUrl.com</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>BuildDate : 2013_10_16__17:13:46</description>
<releaseNotes>My Release Notes.</releaseNotes>
<copyright>Copyright 2013</copyright>
<tags>MyTag1 MyTag2</tags>
<dependencies>
<!--
<dependency id="SampleDependency" version="1.0" />
-->
</dependencies>
</metadata>
</package>
worked for me.
I am using 2.7.40809.172.
So try:
( Number 1 )
take out your
<dependencies>
(just for kicks)
( Number 2 )
~try a later version of
NuGet.exe
(although based on the documentation, you should be ok)
I pulled
1.0.1-alpha
straight from the documentation.
Start with that, then work your way up to your custom value.
http://docs.nuget.org/docs/reference/versioning
So I took your nuspec , and put it in my demo code.
and it worked! (I'm xml updating the description, fyi, thus the small discrepancy) (see xml below)
But I got a nice "xxx.Web.Mvc.1.0.3-prelrelease1.nupkg" file created.
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>xxx.Web.Mvc</id>
<version>1.0.3-prelrelease1</version>
<authors>xxx</authors>
<owners>xxx</owners>
<projectUrl>https://xxx</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>BuildDate : 2013_10_17__11:29:15</description>
<releaseNotes>NuGet package.</releaseNotes>
<copyright>Copyright 2013 xxx</copyright>
<tags>asmx xxx</tags>
<dependencies>
<dependency id="Microsoft.AspNet.Mvc" version="4.0.30506.0" />
<dependency id="Microsoft.AspNet.Razor" version="2.0.30506.0" />
<dependency id="Microsoft.AspNet.WebPages" version="2.0.30506.0" />
<dependency id="Microsoft.Web.Infrastructure" version="1.0.0.0" />
</dependencies>
</metadata>
</package>
So maybe it has something to do with the "contents", not the spec.
So you can do a "basic" package, like:
.\Package.nuspec
.\content\
.\content\SomeImageFile.png
.\lib\
.\lib\net20\SomeDll.dll
and see if that works with your nuspec file with the pre-release versioning?