using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Routing;
using Nop.Web.Framework.Localization;
using Nop.Web.Framework.Mvc.Routing;
namespace Nop.Plugin.Misc.FacebookPixel.Infrastructure
{
public partial class RouteProvider : IRouteProvider
{
/// <summary>
/// Register routes
/// </summary>
/// <param name="routeBuilder">Route builder</param>
public void RegisterRoutes(IRouteBuilder routeBuilder)
{
routeBuilder.MapLocalizedRoute("Plugin.Misc.FacebookPixel.HomePage",
"",
new {controller = "Home", action = "Index"},
new[] { "Nop.Plugin.Misc.FacebookPixel.Controllers" });
}
/// <summary>
/// Gets a priority of route provider
/// </summary>
public int Priority => int.MaxValue;
}
it causes:
An error occurred while starting the application.
RouteCreationException: The constraint entry 'Length' - '1' on the route '' must have a string value or be of a type which implements 'Microsoft.AspNetCore.Routing.IRouteConstraint'.
Microsoft.AspNetCore.Routing.RouteConstraintBuilder.AddConstraint(string key, object value)
RouteCreationException: An error occurred while creating the route with name 'Plugin.Misc.FacebookPixel.HomePage' and template ''.
Microsoft.AspNetCore.Routing.RouteBase..ctor(string template, string name, IInlineConstraintResolver constraintResolver, RouteValueDictionary defaults, IDictionary<string, object> constraints, RouteValueDictionary dataTokens)
RouteCreationException: The constraint entry 'Length' - '1' on the route '' must have a string value or be of a type which implements 'Microsoft.AspNetCore.Routing.IRouteConstraint'.
Microsoft.AspNetCore.Routing.RouteConstraintBuilder.AddConstraint(string key, object value)
Microsoft.AspNetCore.Routing.RouteBase.GetConstraints(IInlineConstraintResolver inlineConstraintResolver, RouteTemplate parsedTemplate, IDictionary<string, object> constraints)
Microsoft.AspNetCore.Routing.RouteBase..ctor(string template, string name, IInlineConstraintResolver constraintResolver, RouteValueDictionary defaults, IDictionary<string, object> constraints, RouteValueDictionary dataTokens)
I need help solving this error, I don't know what happens. Thank you