I was forced to update Microsoft.AspNet.WebApi.Client and Microsoft.AspNet.WebApi.Core from version 5.0.0.0 to 5.2.0.0 due to a dependency on another project, and now my API throws an error "A direct route cannot use the parameter "controller." Specify a literal path instead of this parameter to create a route to the controller. "
The error is caused when HttpConfiguration is initialized in Global.asax.cs when called
GlobalConfiguration.Configure(WebApiConfig.Register);
It seems that the main library is causing the problem. When I updated only the client, it did not give an error.
I noticed that if I comment on the attributes of the route from all the controllers within the project, then it no longer throws an error, for example.
[Route("api/storage/series/{series}/documentId/{documentId}")]
However, deleting this data is not a viable solution due to the number of dependent applications.
In Google / Binging the error there is almost zero useful information about this. Can anyone tell me about this error and suggest how I can fix it?
c # asp.net-web-api asp.net-mvc-routing
B lat
source share