Search code examples
nugetnuget-packagenuget-package-restorenuget-server

Hosting private nuget server issue


I have setup my own nuget feed and have hosted that on our dev server.

When I try to push my packages from my local machine to dev machine as below:

dotnet nuget push C:\MyProjects\Common.2.0.0.nupkg -k myapi -s https://mydev.com/AENuget/

I get the error as:

Response status code does not indicate success: 405 (Method Not Allowed).

Now I have read and tried many settings like adding

<remove name="WebDAV" /> <remove name="WebDAVModule" />

Giving permissions to my nuget packages folder, adding app pool account but still I am not able to resolve this issue.

Secondly instead of pushing if I just copy my nuget package file to the package folder being hosted in our dev server and then in visual studio I add the new server source I get the below error:

[Package Source] The V2 feed at 'http://mydev.com/AENuget/Search()?$filter=IsLatestVersion&searchTerm=''&targetFramework=''&includePrerelease=false&$skip=0&$top=26&semVerLevel=2.0.0' returned an unexpected status code '404 Not Found'.

So looks like neither the push from nuget nor the copy is working. Looks like some permission issue which I am not able to resolve. Would appreciate if someone can provide any inputs to this.

FYI: This works fine if I host this on my local machine.


Solution

  • The problems you are having seem to indicate you are having issues with the NuGet.Server and the system itself. These can be problems with the firewall, hosting configuration (IIS), or a wide variety of problems.

    If you are on a very small team, you might just create a shared folder on a network server (with read/write access for the team). You can add the package source to Visual Studio by following this article. The source will be the UNC path to the directory (e.g. \\servername\path\to\nuget\folder).

    NuGet.Server is a package provided by Microsoft and NuGet. This is used widely so I do not believe you have a problem with the package. If you encounter a specific problem, we may be able to help.