I am getting a (405) Method Not Found error when attempting to push a package to my locally hosted Nuget Server (Nuget.Server package) hosted on IIS 7.5 on Windows 2008 R2 Enterprise.
There is a dedicated IIS site configured for the nuget server (Called Nuget) and bound to a specific port (81 for fun).
The app pool is setup to be .NET Framework 4.0 and is in Integrated Pipeline mode.
I understand that I might need to enable PUT and DELETE verbs but have no idea which handler is responsible for handling the Nuget requests.
In integrated pipeline mode, the correct handler is the svc-Integrated-4.0 handler.
I found this out by trial and error and by reading through the source code of the Nuget Server on Codeplex.
This article on how ASP.NET processes your requests is also very helpful in understanding what is taking place under the covers.
Additionally, for this answer to be the correct one, you need to ensure that the application pool is in Integrated Pipeline mode and not Classic mode.
The relevant section of your Web.config that will need to change is listed below, specifically the list of verbs that are now supported.
<system.webServer>
<handlers>
<remove name="svc-Integrated-4.0" />
<add name="Elmah" path="elmah.axd" verb="POST,GET,HEAD" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode" />
<add name="svc-Integrated-4.0" path="*.svc" verb="GET,PUT,POST,DELETE,DEBUG" type="System.ServiceModel.Activation.ServiceHttpHandlerFactory, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
</system.webServer>
Adding <remove name="WebDAVModule" />
to system.webServer/modules
worked fine for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With