November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
First a quick check. Which versions of EPiServer.Shell.UI.dll and EPiServer.Cms.Shell.UI.dll do you have in the modulesbin folder of the site?
What path are you requesting? The idea is that the EPiServer controllers should be restricted to the ui paths.
If you browse to <your ui path>/shell/debug/routes you can see the configured routes and maybe figure out what's matching your request.
2.1.82.0 - EPiServer.CMS.Shell.UI
2.1.90.0 - EPiServer.Shell.UI
This seems to happen when I request any path that is mapped to a "HomeController". I have verified my route is "hit", because when I adjust my route to point at a different controller than "HomeController", the alternate controller loads. For instance, I have the following route:
var defaultHome = routes.MapRoute(
name:
"DefaultHome",
url:
"Home/{action}/{id}",
defaults:
new { controller = "Home", action = "Index", id = UrlParameter.Optional },
namespaces:
new[] { "Mosaic.Controllers" }
);
defaultHome.DataTokens[
"area"] = "";
defaultHome.DataTokens[
"UseNamespaceFallback"] = false;
If I run the version above, requesting mysite/Home I get the error in my original post. However, if I modify it to:
var defaultHome = routes.MapRoute(
name:
"DefaultHome",
url:
"Home/{action}/{id}",
defaults:
new { controller = "Account", action = "Index", id = UrlParameter.Optional },
namespaces:
new[] { "Mosaic.Controllers" }
);
defaultHome.DataTokens[
"area"] = "";
defaultHome.DataTokens[
"UseNamespaceFallback"] = false;
Then the request for mysite/Home works. This same issue happens for all of my Areas, but so far, *only* for those routes mapped to a HomeController. It's like my namespace arguments are entirely ignored, and if EPiServer finds that the controller requested is "Home", then it automatically tries to use EPiHomeController.
I'm not sure if the issue is in
in EPiServer.Web.MVC? It's like the type coming back is always replaced with EPiServer's controller?
Do you have patch 3 installed? There was a bug when using certain controller names:
97346 - Some URL segements for pages such as "About" does not work because of name collisions with Controllers
http://world.episerver.com/Articles/Items/EPiServer-7---Patch-3/
This does seem to be the exact behavior I'm seeing, but I just updated from the NuGet feed this week. When I visit the NuGet package manager it shows that I have the latest versions of EPiServer.CMS.Core and EPiServer.Framework (althouth the description of each does not show the actual patch #).
Is there a means I can verify the patch # based on dll versions?
If you've updated to a patch within the last week, you should have patch 3. The patch 3 DLLs versions end with .16 (compared with .8 for patch 2 and .4 (or .3) for patch 1).
I ended up having to rename my HomeController(s) to HomeInternalController and explicitly map my routes to "HomeInternal", rather than "Home". Any time my routes mapped a route to a controller name "Home", EPiServer tries to call the EPiHomeController.
For now, my code is "working", but I'm not really happy with this fix.
This seems to be an issue introduced with one of the patches. I've managed to reproduce it with patch 3, but as far as I can tell it doesn't happen on an unpatched system.
I've filed a bug report for it.
Since upgrading to 7.1, any "regular" (non EPiServer derived) controller named "HomeController" fails to get resolved. Instead, the 'EPiServer.Shell.UI.Controllers.EPiHomeController' controller is attempted... and it fails with the following:
No parameterless constructor defined for this object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.MissingMethodException: No parameterless constructor defined for this object.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace: