c# - Web Api Controller Routes Randomly Stop Working -
i have apicontroller called mediacontroller, routes mapped methods via [route] attribute. example:
[route("v1/libraries/{librarykey}/media"), httpget] public responseobj index(string librarykey) { ... }
these routes registered in webapiconfig.cs via config.maphttpattributeroutes();
the problem i'm running routes specific controller (all others fine , unaffected) randomly stop working together, , attempting go 1 triggers error following message
{ "message": "no http resource found matches request uri 'http://localhost:8100/v1/libraries/librarykey/media'.", "messagedetail": "no route data found request." }
the way i've found (temporarily) fix remove git repository project computer, , re-download it. don't know why works because there no noticeable difference in files before , after deletion.
managed figure out cause of this. had rogue .dll file in project's bin directory (which being ignored git, hence why looked there no file differences , deleting whole repo worked temp fix) being referenced separate project, in turn referenced main project.
this .dll included controller same name (mediacontroller
), difference routes, , unknown circumstances cause controller's routes register in place of intended main project's mediacontroller
routes.
Comments
Post a Comment