首页 > 解决方案 > 错误:“AmbiguousMatchException:请求匹配多个端点。”

问题描述

在http://localhost:56191/WebImages/index中请求页面时出现错误:

*An unhandled exception occurred while processing the request.*<br>
*AmbiguousMatchException: The request matched multiple endpoints. Matches:*

*WebApp.Controllers.WebImagesController.Index (WebApp)*<br>
*WebApp.Views.WebImagesController.Index (WebApp)*

*Microsoft.AspNetCore.Routing.Matching.DefaultEndpointSelector.ReportAmbiguity(CandidateState[] candidateState)*

这可能是因为我因为数据库中的更新而跑了?:

"Scaffold-DbContext "Server=Machinexx; Database=MyDBxx; Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models -force"

标签: c#asp.net-core

解决方案


CodeCaster 是对的。我在 View 文件夹中有另一个同名的控制器,但我不知道它是如何到达那里的。


推荐阅读