RESOLVED: Global Find/Replaced default namespace, now Umbraco cannot resolve routes to my controllers (route hijacking broken)
Hi,
I have a FeedbackPageController which handles requests to any page with the FeedbackPage document type via route hijacking.
namespace MySite.Controllers
{
public class FeedbackPageController : RenderMvcController
{
private IReviewsService reviewsService = DependencyResolver.Current.GetService<IReviewsService>();
public async Task<ActionResult> FeedbackPage(RenderModel model)
{
var viewModel = new FeedbackPageViewModel(model.Content);
viewModel.Reviews = await reviewsService.GetReviews();
return CurrentTemplate(viewModel);
}
}
}
Let's say that my site's original default namespace was "MySite.co.uk". I changed this to "MySite" by doing a global find and replace and updating my .csproj file with the new namespace.
Now, when I navigate to /feedback, I'm getting this YSOD:
It's like Umbraco can't resolve the route to my controller any more.
Before you ask, there is no MySite.co.uk.Controllers.FeedbackPageController in my solution, I only have a MySite.Controllers.FeedbackPageController.
I don't know how there can still be an ambiguous reference, when there is only one of these controllers present in the solution.
Any tips to get "route hijacking" working properly again?
UPDATE: I renamed the FeedbackPageController back to MySite.co.uk.Controllers.FeedbackPageController and now I get this YSOD:
RESOLVED: Global Find/Replaced default namespace, now Umbraco cannot resolve routes to my controllers (route hijacking broken)
Hi,
I have a
FeedbackPageController
which handles requests to any page with theFeedbackPage
document type via route hijacking.Let's say that my site's original default namespace was "
MySite.co.uk
". I changed this to "MySite
" by doing a global find and replace and updating my.csproj
file with the new namespace.Now, when I navigate to
/feedback
, I'm getting this YSOD:It's like Umbraco can't resolve the route to my controller any more.
Before you ask, there is no
MySite.co.uk.Controllers.FeedbackPageController
in my solution, I only have aMySite.Controllers.FeedbackPageController
.I don't know how there can still be an ambiguous reference, when there is only one of these controllers present in the solution.
Any tips to get "route hijacking" working properly again?
UPDATE: I renamed the
FeedbackPageController
back toMySite.co.uk.Controllers.FeedbackPageController
and now I get this YSOD:It really is like there are two controllers.
What is going on here?
Do you still have the old DLL in the bin folder? So MySite.dll and MySite.co.uk.dll?
Yep, that was it David. The old DLL was still present in the bin folder.
is working on a reply...