Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Bijesh Tank 192 posts 420 karma points
    Jan 08, 2016 @ 09:29
    Bijesh Tank
    0

    Error: A route named 'umbraco-surface-UmbProfile' is already in the route collection

    Hi,

    For about a week now I've been getting a strange error that keeps popping up randomly:

    A route named 'umbraco-surface-UmbProfile' is already in the route collection. Route names must be unique.
    Parameter name: name
    
    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: System.ArgumentException: A route named 'umbraco-surface-UmbProfile' is already in the route collection. Route names must be unique.
    Parameter name: name
    
    Source Error: 
    
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
    
    Stack Trace: 
    
    
    [ArgumentException: A route named 'umbraco-surface-UmbProfile' is already in the route collection. Route names must be unique.
    Parameter name: name]
       System.Web.Routing.RouteCollection.Add(String name, RouteBase item) +3713529
       System.Web.Mvc.RouteCollectionExtensions.MapRoute(RouteCollection routes, String name, String url, Object defaults, Object constraints, String[] namespaces) +361
       Umbraco.Web.WebBootManager.RouteLocalSurfaceController(Type controller, String umbracoPath) +274
       Umbraco.Web.WebBootManager.RoutePluginControllers() +362
       Umbraco.Web.WebBootManager.Complete(Action`1 afterComplete) +84
       Umbraco.Core.UmbracoApplicationBase.StartApplication(Object sender, EventArgs e) +395
    
    [HttpException (0x80004005): A route named 'umbraco-surface-UmbProfile' is already in the route collection. Route names must be unique.
    Parameter name: name]
       System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +12601933
       System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +175
       System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +304
       System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +404
       System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +475
    
    [HttpException (0x80004005): A route named 'umbraco-surface-UmbProfile' is already in the route collection. Route names must be unique.
    Parameter name: name]
       System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12618980
       System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
       System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12458597
    

    I've checked my App_Code folder and it's empty and no other routes have been created that match what is stated in this error.

    Using Umbraco 7.3.3.

    Anyone experience or come across this? It's getting quite annoying now and I can't reproduce it at will, it just seems to happen at random moments.

    Thanks, B.

  • Bijesh Tank 192 posts 420 karma points
    Jan 08, 2016 @ 11:45
    Bijesh Tank
    0

    Just some additional info to add:

    To get my site working again I have to recompile the site in Visual Studio. Doing an app pool recycle or iisreset doesn't work.

    I've also made sure I've deleted all the DLL's in the bin folder and done a fresh compile. Seems to be OK for a while until the error crops up again at a random time.

    I've installed RouteDebugger and this doesn't report anything unusual. The route 'umbraco/surface/UmbProfile' only appears once.

  • Ravi Motha 290 posts 500 karma points MVP 8x c-trib
    Jan 08, 2016 @ 11:52
    Ravi Motha
    0

    is the reference to umbraco-surface-UmbProfile being called somewhere else..

  • Bijesh Tank 192 posts 420 karma points
    Jan 08, 2016 @ 11:57
    Bijesh Tank
    0

    I can't see it referenced anywhere, not that I can see anyway. The site used to work fine before and not a lot of development (backend) work has been done on the site since the last month.

    The only major thing that has happened on the site is an upgrade, 7.3.2 -> 7.3.3.

  • Ravi Motha 290 posts 500 karma points MVP 8x c-trib
    Jan 08, 2016 @ 12:03
    Ravi Motha
    1

    weird.. you may need to have a look to see if anything has changed in the upgrade with regard to routing that is causing your issue..

    is the error occurring when you do a specific set of actions or generating an overall error you can't relate to a bunch of tasks?

  • Bijesh Tank 192 posts 420 karma points
    Jan 08, 2016 @ 13:02
    Bijesh Tank
    0

    Hmmm it could be something to do with the upgrade. Reason I say that is I'm able to recreate the error consistently now by installing a package via the backoffice - I've tried on 4 different packages and when does the final install the site bombs out and display the error.

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Jan 08, 2016 @ 15:07
    Ismail Mayat
    1

    bijesh,

    I recall seeing this before. From what i can remember i think it was inherited site and that was in the vs sln referencing umbraco dlls from a folder. The upgrade was done using nuget and some dlls refs got messed up.

    Check all your references also how was the upgrade done? Also try clean build then build.

    Regards

    Ismail

  • Bijesh Tank 192 posts 420 karma points
    Jan 08, 2016 @ 15:57
    Bijesh Tank
    0

    Ah ok, another thing worth looking at.

    I upgraded using NuGet, so could be an issue with DLL refs as you mentioned.

    I've done a clean build, even deleting the bin & obj folders - still the same issue.

    Thanks!

  • Ed Parry 64 posts 252 karma points c-trib
    Apr 17, 2018 @ 10:03
    Ed Parry
    2

    Came across this while trying to solve the same issue.

    For me it was caused by a change in namespace at the project level. This left two versions of the same DLLs in the /bin folder which even the project clean didn't remove, so it meant the same start-up code was running twice. Removing the old DLLs resolved it for me. Appreciate it didn't solve the above problem, but could point others in the right direction.

  • Joe 32 posts 136 karma points
    Sep 14, 2018 @ 18:25
    Joe
    1

    Cheers! Similar cause and solution with my case.

    I renamed the project and simply build-and-run, then it throws similar error. I found the {old-project-name}.dll was still in the \bin directory even I clean the project & solution. I need to manually delete the {old-project-name}.dll, then it works!

  • kris-guy 3 posts 23 karma points
    Oct 07, 2020 @ 08:32
    kris-guy
    0

    Super helpful. Top marks all around.

  • Markus Johansson 1938 posts 5866 karma points MVP 2x c-trib
    Oct 30, 2018 @ 09:56
    Markus Johansson
    0

    Cheers for the help!

    In my case I had a branch in my gitrepo and since we don't track the bin-folder there was some DLLs there from another version of Umbraco.

    Cleaning the solution and/or "Rebuild" did not remove all the dlls so manually making sure that the bin-folder was empty and then build did the trick for me.

Please Sign in or register to post replies

Write your reply to:

Draft