在WebAPI .NET 4.8 HTTP错误403.14中使用Swashbuckle 5.6.0-禁止
我在现有的.NET 4.8 WebAPI上实施Swagger时遇到了一些麻烦。
使用VS2019,我使用Nuget软件包管理器安装了SwashBuckle 5.6.0,它已将SwaggerConfig.cs添加到App_start文件夹中。我已经离开了这个文件库存标准。
在线示例似乎意味着现在应该运行。我正在本地进行调试。我启动服务,默认情况下,该服务转到http:// localhost:53374/aget2.aspx
。到达那里后,我将URL更改为http:// localhost:53374/swagger/
。
当我收到以下错误时:
HTTP错误403.14-禁止Web服务器配置为未列出此目录的内容。
尝试的事情:
- 删除
.vs
文件夹 - 在根下面检查一个摇摇欲坠的文件夹,结果:没有
- 尝试将URL更改为:
http:// localhost:53374/swagger/swagger/ui/index < /code>,没有运气,
我没有启用目录浏览,因为我不认为这就是需要的,因为我用Swagger测试了一个简单的核心API项目,并且没有此功能。
我还能尝试什么?任何想法都是最欢迎的。
可能是Swagger需要某种类型的授权吗?
I'm having a little trouble implementing Swagger on an existing .NET 4.8 WebApi.
Using VS2019 I have used Nuget Package Manager to install Swashbuckle 5.6.0, it has added SwaggerConfig.cs into the App_Start folder. I have left this file stock-standard.
Online examples seem to imply that it should now run. I am running it locally in debug. I start the service, which by default goes to http://localhost:53374/about2.aspx
. Once there I alter the URL to http://localhost:53374/swagger/
.
That when I get the following error:
HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory.
Things tried:
- deleting the
.vs
folder - checking for a Swagger folder under the root, result: nothing
- tried altering the URL to:
http://localhost:53374/swagger/ui/index
, no luck
I haven't enabled directory browsing as I don't think that is what this needs, as I tested a simple core API project with Swagger and it worked without this.
What else could I try? Any ideas are most welcome.
Could it be that Swagger needs some type of authorization?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论