I\'m doing an ASP.NET MVC 3 web service and I keep getting this exception intermittently.
Stack trace:
Server Error in \'/\' Application.
A route n
If you are versioning, and you use two APIs with the same name, you will get this error. If you need the same Get, try changing the Name attribute of the route:
TestsController.cs:
[MapToApiVersion("1.0")]
[Route("{moniker}", Name = "GetTest")]
public async Task Get(string moniker, bool param1 = false)
[MapToApiVersion("1.1")]
[Route("{moniker}", Name = "GetTest11")] // Change name here for a different version
public async Task Get(string moniker)
And pass in the version in the URL:
http://localhost:6600/api/tests/2020?api-version=1.1