dotnet nuget push nuget 包出现 error: Response status code does not indicate success: 405 (Not Allowed)

背景

我在执行

dotnet nuget push 包.nupkg -k <apikey> -s <url>

脚本推送nuget包的时候一直返回一个错误
error: Response status code does not indicate success: 405 (Not Allowed).
在这里插入图片描述

解决方案

后来发现我iis中安装了一个服务【WebDav创作规则】
把这玩意卸载就可以正常运行了

卸载方式

1.打开【启用或关闭Windows功能】
2.点击Internet Information Services
3.万维网服务
4.常见HTTP功能
5.WebDAV发布 前面的勾选去掉
6.点击确定,完成卸载
在这里插入图片描述

效果

最后直接成功
在这里插入图片描述