when i write following code in my plugin RouteProvider.cs
public void RegisterRoutes(IRouteBuilder routeBuilder)
{
routeBuilder.MapLocalizedRoute("CustomLogin",
"Login/",
new { controller = "CustomCustomer", action = "Login" },
new { },
new[] { "WebPooye.Plugins.SMS.WpSMS.Controllers" }
);
}
public int Priority
{
get { return int.MaxValue; }
}
i have this exception :
An unhandled exception occurred while processing the request.
InvalidOperationException: The view 'Login' was not found. The following locations were searched:
/Themes/DefaultClean/Views/CustomCustomer/Login.cshtml
/Themes/DefaultClean/Views/Shared/Login.cshtml
/Views/CustomCustomer/Login.cshtml
/Views/Shared/Login.cshtml
/Pages/Shared/Login.cshtml
and when i write this :
public void RegisterRoutes(IRouteBuilder routeBuilder)
{
routeBuilder.MapLocalizedRoute("CustomLogin",
"Login/",
new { controller = "CustomCustomer", action = "Login" },
new[] { "WebPooye.Plugins.SMS.WpSMS.Controllers" }
);
}
public int Priority
{
get { return int.MaxValue; }
}
i have this error :
An error occurred while starting the application.
RouteCreationException: The constraint entry 'Length' - '1' on the route 'Login/' 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 'CustomLogin' and template 'Login/'.
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 'Login/' 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)