NuGet product used: nuget.exe
NuGet version: 4.7.0.5148
OS version: win10-x64-1803
Two packages to publish:
A) Sample.AppPackage.1.1.0-preview-1-0-01304-003-123-a-very-large-branchname.nupkg
B) Sample.AppPackage.Extensions.HtmlReports.1.1.0-preview-1-0-01304-003-123-a-very-large-branchname.nupkg
1. Package A) published:
nuget push -Verbosity detailed Sample.AppPackage.1.1.0-preview-1-0-01304-003-123-a-very-large-branchname.nupkg -Source https://nuget.example.com/api/v2/
->
NuGet Version: 4.7.0.5148
Pushing Sample.AppPackage.1.1.0-preview-1-0-01304-003-123-a-very-large-branchname.nupkg to 'https://nuget.example.com/api/v2/'...
PUT https://nuget.example.com/api/v2/
Created https://nuget.example.com/api/v2/ 1048ms
Your package was pushed.
2. Package B) publishing failed:
nuget push -Verbosity detailed Sample.AppPackage.Extensions.HtmlReports.1.1.0-preview-1-0-01304-003-123-a-very-large-branchname.nupkg -Source https://nuget.example.com/api/v2/
->
NuGet Version: 4.7.0.5148
Pushing Sample.AppPackage.Extensions.HtmlReports.1.1.0-preview-1-0-01304-003-123-a-very-large-branchname.nupkg to 'https://nuget.example.com/api/v2/'...
PUT https://nuget.example.com/api/v2/
NotAcceptable https://nuget.example.com/api/v2/ 248ms
Response status code does not indicate success: 406 (Not Acceptable).
What's going on here?
I know, that a SemVer v1 package can only be a 20 character long prerelease label.
But hey! Both packages have a prerelease label with 49 characters!? The only difference is the complete filename length!?
I use also long name for package (1.0.0-alpha-aaaaa-bbbbbbbbbbbbbbbbb.1) and I my case the error HTTP 406 happen because of a package size problem.
IIS by default does allow request with more than 30.72 mo son I had to change maxRequestLength in my web config to a kb value higher than the packages size I had to send.
<httpRuntime targetFramework="4.6" maxRequestLength="100000" />
@jobou363 ,Thanks for your Answer, Its worked for me
Most helpful comment
I use also long name for package (1.0.0-alpha-aaaaa-bbbbbbbbbbbbbbbbb.1) and I my case the error HTTP 406 happen because of a package size problem.
IIS by default does allow request with more than 30.72 mo son I had to change maxRequestLength in my web config to a kb value higher than the packages size I had to send.