tuc*_*caz 30 push nuget nuget-server
当我尝试推送时,我的NuGet服务器正在抛出405 Not Allowed.至少,这就是NuGet控制台所说的:
Failed to process request. 'Method Not Allowed'.
The remote server returned an error: (405) Method Not Allowed..
Run Code Online (Sandbox Code Playgroud)
但是当我看到Fiddler的实际HTTP响应时,问题似乎完全不同:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code></code>
<message xml:lang="en-US">The URL representing the root of the service only supports GET requests.</message>
</error>
Run Code Online (Sandbox Code Playgroud)
关于可能发生的事情的任何想法?
谢谢!
Kev*_*yth 54
除了使用nuget push -Source http://nugetserver.com
,我做了这个:
<!--Add the following to the beginning of <system.webServer><modules>:-->
<remove name="WebDAVModule" />
<!--Add the following to the beginning of <system.webServer><handlers>:-->
<remove name="WebDAV" />
Run Code Online (Sandbox Code Playgroud)
资料来源:Nuget问题#1789
tuc*_*caz 50
经过几个小时的工作,我找到了问题.
在NuGet服务器中列出软件包时,请指向http://nugetserver.com/ nuget.但是,当您尝试推送或删除程序包时,您需要指向http://nugetserver.com而不在路径中使用nuget文件夹.
会发生什么是NuGet.exe将/ api/v2/package附加到URL,将其转换为http://nugetserver.com/ api/v2/package
我认为这远非最佳,因为它会让你为nuget.exe.config添加两个不同的源:一个用于get/list,另一个用于推送/删除包.