Inhalte aufrufen

Profilbild

Route named '...' could not be found on Smartstore 4.0.0

router name error

Best Answer Marcus Gesing , 21 December 2020 - 10:52

You are using a localized route, so this is probably because the entity "BuildPC" does not implement the interface ISlugSupported.

Go to the full post


  • Bitte melden Sie sich an, um eine Antwort zu verfassen.
2 Antworten zu diesem Thema

#1 giakien

giakien

    Newbie

  • Members
  • Punkt
  • 8 Beiträge

Geschrieben: 20 December 2020 - 09:21

Hello everyone,
After creating a new module on "Build computer configuration" and add it to the admin page. If you select Edit function name, the Router Name cannot be found when creating a new module.
System.ArgumentException: A route named 'BuildPC' could not be found in the route collection.
Parameter name: name
at System.Web.Routing.RouteCollection.GetVirtualPath(RequestContext requestContext, String name, RouteValueDictionary values)
at System.Web.Mvc.RouteCollectionExtensions.GetVirtualPathForArea(RouteCollection routes, RequestContext requestContext, String name, RouteValueDictionary values, Boolean& usingAreas)
at System.Web.Mvc.UrlHelper.GenerateUrl(String routeName, String actionName, String controllerName, RouteValueDictionary routeValues, RouteCollection routeCollection, RequestContext requestContext, Boolean includeImplicitMvcValues)
at System.Web.Mvc.UrlHelper.GenerateUrl(String routeName, String actionName, String controllerName, String protocol, String hostName, String fragment, RouteValueDictionary routeValues, RouteCollection routeCollection, RequestContext requestContext, Boolean includeImplicitMvcValues)
at System.Web.Mvc.UrlHelper.RouteUrl(String routeName, Object routeValues, String protocol)
at SmartStore.Admin.Controllers.BuildPCController.PrepareBuildPCModel(BuildPCModel model, BuildPC buildPC, Boolean excludeProperties) in E:\ThemeViet\2021\ThemeViet4\src\Presentation\SmartStore.Web\Administration\Controllers\BuildPCController.cs:line 132
at SmartStore.Admin.Controllers.BuildPCController.Edit(Int32 id) in E:\ThemeViet\2021\ThemeViet4\src\Presentation\SmartStore.Web\Administration\Controllers\BuildPCController.cs:line 288
at lambda_method(Closure , ControllerBase , Object[] )
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c.<BeginInvokeSynchronousActionMethod>b__9_0(IAsyncResult asyncResult, ActionInvocation innerInvokeState)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass11_0.<InvokeActionMethodFilterAsynchronouslyRecursive>b__0()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass11_2.<InvokeActionMethodFilterAsynchronouslyRecursive>b__2()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass11_2.<InvokeActionMethodFilterAsynchronouslyRecursive>b__2()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass11_2.<InvokeActionMethodFilterAsynchronouslyRecursive>b__2()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass11_2.<InvokeActionMethodFilterAsynchronouslyRecursive>b__2()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass11_2.<InvokeActionMethodFilterAsynchronouslyRecursive>b__2()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass11_2.<InvokeActionMethodFilterAsynchronouslyRecursive>b__2()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass11_2.<InvokeActionMethodFilterAsynchronouslyRecursive>b__2()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass11_2.<InvokeActionMethodFilterAsynchronouslyRecursive>b__2()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass3_6.<BeginInvokeAction>b__4()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass3_1.<BeginInvokeAction>b__1(IAsyncResult asyncResult)
 
Although I created it in Infrastructure \ Routes \ 3_GenericRoutes.cs
 new GenericPath
                {
                    EntityName = "BuildPC",
                    IdParamName = "buildid",
                    Order = int.MinValue + 7,
                    Route = routes.CreateLocalizedRoute(UrlTemplateFor("BuildPC"), new { controller = "BuildingPC", action = "BuildPc" }, new[] { "SmartStore.Web.Controllers" })
                },
Run homepage 
 
Unsupported EntityName for UrlRecord: BuildPC
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: SmartStore.SmartException: Unsupported EntityName for UrlRecord: BuildPC

Source Error:

Line 185: }
Line 186:
Line 187: var route = path.Route;
Line 188:
Line 189: data.Values["controller"] = route.Defaults["controller"];
Source File: E:\ThemeViet\2021\ThemeViet4\src\Presentation\SmartStore.Web.Framework\Seo\GenericPathRoute.cs    Line: 187

So who knows how to fix such errors, please help me.

Best regards.
 

 



#2 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3801 Beiträge

Geschrieben: 21 December 2020 - 10:52   Best Answer

You are using a localized route, so this is probably because the entity "BuildPC" does not implement the interface ISlugSupported.


  • giakien gefällt das

Marcus Gesing

Smartstore AG


#3 giakien

giakien

    Newbie

  • Members
  • Punkt
  • 8 Beiträge

Geschrieben: 02 February 2021 - 08:26

You are using a localized route, so this is probably because the entity "BuildPC" does not implement the interface ISlugSupported.

Thanks, This problem I have fixed.