I see in Umbraco log viewer a lot of errors like this one:
System.NotImplementedException: The method or operation is not implemented.
at project.Code.RegisterCustomRouteComponent.Terminate() in d:\a\1\s\project\Code\SupplierProfileRoute.cs:line 36
at Umbraco.Core.Composing.ComponentCollection.Terminate() in d:\a\1\s\src\Umbraco.Core\Composing\ComponentCollection.cs:line 47
at Umbraco.Web.UmbracoApplicationBase.HandleApplicationEnd() in d:\a\1\s\src\Umbraco.Web\UmbracoApplicationBase.cs:line 114
I know that this exception is thrown by this line : throw new NotImplementedException(); I am just not sure if that is normal or I did something wrong.
This is my custom route code:
public class SupplierProfileRoute : ComponentComposer<RegisterCustomRouteComponent>
{
}
public class RegisterCustomRouteComponent : IComponent
{
public void Initialize()
{
RouteTable.Routes.MapUmbracoRoute("SupplierProfile", "supplier-profile/{id}", new
{
controller = "SupplierProfile",
action = "SupplierProfile",
id = UrlParameter.Optional
}, new UmbracoVirtualNodeByIdRouteHandler(1140));
RouteTable.Routes.MapUmbracoRoute("SupplierProfileEn", "en/supplier-profile/{id}", new
{
controller = "SupplierProfile",
action = "SupplierProfile",
id = UrlParameter.Optional
}, new UmbracoVirtualNodeByIdRouteHandler(1140));
}
public void Terminate()
{
throw new NotImplementedException();
}
}
What Bo said. I have a working custom route and my Terminate methoid is empty. I believe Umbraco automatically enters it so since yours throws an exception it will always throw an exception. My method is empty so nothing will happen but it will still enter it.
Custom route exception
Hi all,
I see in Umbraco log viewer a lot of errors like this one:
I know that this exception is thrown by this line :
throw new NotImplementedException();
I am just not sure if that is normal or I did something wrong.This is my custom route code:
Hi Josip.
Just remove
throw new NotImplementedException();
and leave theTerminate()
method empty if you do not need any logic there.What Bo said. I have a working custom route and my Terminate methoid is empty. I believe Umbraco automatically enters it so since yours throws an exception it will always throw an exception. My method is empty so nothing will happen but it will still enter it.
is working on a reply...