我添加了一个新的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}/")]
我看不到有两个控制器之间的相同的任何地方