I have an ApiController called MediaController, with routes mapped to methods via the [Route] attribute. For example:
[Route("v1/libraries/{libraryKey}/media"), HttpGet]
public ResponseObj Index(string libraryKey)
{
...
}
These routes are registered in my WebApiConfig.cs via config.MapHttpAttributeRoutes();
The problem I'm running into is that the routes for this specific controller (all others are fine and unaffected) will sometimes randomly stop working all together, and attempting to go to one triggers a error with the following message
{
"message": "No HTTP resource was found that matches the request URI 'http://localhost:8100/v1/libraries/libraryKey/media'.",
"messageDetail": "No route data was found for this request."
}
The only way I've found to (temporarily) fix this is to completely remove the git repository for the project from my computer, and re-download it. I don't know why this works because there are no noticeable difference in the files before and after the deletion.