nuget 命令上传的时候报错method not allowed 405

nuget 命令上传的时候报错method not allowed 405,第1张

产生这个错误是由于IIS安装了WebDAV模块
删除WebDAV Module与WebDAV Hanlder,上传时会返回404错误,通过浏览器访问路径nuget/Packages也是404错误。
查看IIS日志发现nuget push实际执行的是>原文见下面, 我简单翻译几句吧:
你先在一台能联网的电脑上装NuGet,并且在一个临时项目上下载安装EF5, 然后在这个临时项目文件夹中就可以找到nupkg 文件, (或在NuGet的Package Manager中浏览Package Cache找到刚才下载的EF5), 然后在你的开发机上安装NuGet, 把它的Feed设为本地, 然后把nupkg文件拷到你开发机中设定的feed文件夹中, 这样在开发机上就可以像联网一样使用NuGet了

What if you can’t connect to the Internet from your development machine Or what if you are not allowed to install NuGet on your machine Don’t worry; all is not lost
First you need to get the NuGet package For this you do need to be able to connect to the Internet from some machine—but it doesn’t have to be your development machine You’re reading this so presumably you’re not completely off-the-grid :-)
You can get the package by using NuGet in Visual Studio on a machine connected to the Internet in the normal way—just install the package you want into a dummy project After installing the package you can find the nupkg file either in the dummy project folder or by browsing the Package Cache from the Package Manager Settings menu option
You can also get the package without Visual Studio by using NuGetexe
If you are able to install NuGet on your development machine then do so and setup a local feed This may sound daunting but it’s really easy Copy the nupkg file to your local feed and then use NuGet to install it in the normal way—with no connection to the Internet required
If you can’t install NuGet on your development machine then take the nupkg file and rename it to zip—yep, it’s a zip file You can now extract EntityFrameworkdll from the zip file and use it as you would any other assembly Note that you will not get any of the automatic project-level integration I mentioned above, so you may have to do more manual configuration of your project


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zz/10860018.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-11
下一篇 2023-05-11

发表评论

登录后才能评论

评论列表(0条)

保存