I'm using ASP.NET MVC 5.1 and have some problems with the latest version of Commerce and routing for NodeContent (categories). VariationContent, ProductContent, BundleContent and PackageContent all work fine and the normal way, but for NodeContent I get a 404 (on page edit) and my controller isen't registered to render for that type, instead it tries to use the EPiServer.Shell.UI.Controllers.EPiDefaultShellModuleController controller.
I have a very basic setup:
public class TestNodeContentController : ContentController<TestNodeContent>
public ViewResult Index()
[CatalogContentType(GUID = "4A08DC98-FE1E-443E-BF0F-123993957118", MetaClassName = "Test_Node_Content")]
public class TestNodeContent : NodeContent
Any ideas where I should look? Somewhere there must be a misconfiguration in my setup.
The URL it tries to use looks something like this: http://demo.commerce.localtest.me/cms/Commerce/Catalog#context=epi.cms.contentdata:///1073741831__CatalogContent.
I didn't get the problem when I tested. Can you run the following code after initialization has been done (for example in one controller): ServiceLocation.ServiceLocator.Current.GetInstance<EPiServer.DataAbstraction.IContentTypeRepository>().Load("TestNodeContent ").SupportedTemplates
You will find the templates that has been registered during initialization in that property. It would be intresting to see if the TestNodeContentController is one of the supported templates.
When I tested within my ProductController it showed that the right controller was registered to handle TestNodeContent (TestNodeContentController). It was also the only one registered for that type. Curious that I get a 404 when within the Catalog interface and then just for types that inherit from NodeContent.
I will try to reproduce it.
One more thing to look up. The TemplateResolver has two events, TemplateResolving and TemplateResolved. If you listen to those events, and look what the template resolver resolves, it might give us a hint.
When I check TemplateResolved, SelectedTemplate is actually TestNodeController. Very strange that it doesn't render that controller and view.
Whats the assembly version of EPiServer.Shell.UI?
I now see that I use 22.214.171.124 of EPiServer.Shell.UI (did a update-package on the project). I can still not get the problem.
Have you registered any routes yourself (the default route for example), and if so, where has it been registered?
I had the default route registered through the RegisterRoutes method in global.asax, but even when removing this method the behavior was the same.