Closed primalfear closed 5 years ago
Hi thanks for the report.
I'll leave this here in case it helps anyone else, plus i'll reproduce when I have a minute and see if its anything that might need fixing.
Thanks ;)
I have experienced something similar, in the past with DotNetCore, when using reflection, and how it loads the app domain. So having not looked at the code, i would assume the controllers are being reflected to populate the RouteMap, and it's not finding the controllers...
I will also have a look at the code base a see if i can spot anything, that could remedy this behavior.
There is another instance which is also causing the routemap to not be populated. When using DotNetCore 2.1 and the controller inherits from "Microsoft.AspNetCore.Mvc.ControllerBase" the RouteMap is Empty.
Resolution: Make sure controllers inherit from "Microsoft.AspNetCore.Mvc.Controller"
Added a PR #18 for the issue mentioned by @primalfear. I had the same issue so i changed the DefaultRouteMap to look for types inheriting from ControllerBase instead.
That's excellent, thanks so much for your contribution.
When riskfirst.hateoas package is referenced by a different project in the solution and not directly referenced by the Web Project the RouteMap has no routes.
Solution Setup.
When i add the RiskFirst.Hateoas package to MySolution.WebApi the RouteMap is correctly populated. Am not logging this as a bug, it was just interesting behavior that was tricky to diagnose.