我添加了一個新的HttpPost路線「API /導出/錯誤/」我的WebAPI,使用屬性路由的網址,而我得到一個錯誤:ASP.net的WebAPI多個控制器類型中發現匹配
Multiple controller types were found that match the URL. This can happen if attribute routes on multiple controllers match the requested URL.\r\n\r\nThe request has found the following matching controller types: \r\nMyApp.Controllers.ExportErrorController\r\nMyApp.Controllers.ExportGeneratorController
但我沒有在我看到的不同控制器中有相同的路線;這裏是在這兩個控制器的唯一途徑:
ExportErrorController.cs
[HttpGet] [Route("api/export/error/total/")]
[HttpPost] [Route("api/export/error/")]
[HttpDelete] [Route("api/export/error/{id}/")]
[HttpPut] [Route("api/export/error/clear/")]
個
ExportGeneratorController.cs
[HttpGet] [Route("api/2/export/{channelId}/")]
[HttpPost] [Route("api/2/export/generate-word/{debugInfo}/")]
[HttpPost] [Route("api/2/export/generate-excel/{debugInfo}/")]
我看不到有兩個控制器之間的相同的任何地方