Copied to clipboard

Flag this post as spam?

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


  • Johan 50 posts 174 karma points
    Aug 08, 2014 @ 16:08
    Johan
    0

    Error:A route named 'umbraco-surface-UmbProfile' is already in the route collection. Route names must be unique.

    Server Error in '/' Application.

    A route named 'umbraco-surface-UmbProfile' is already in the route collection. Route names must be unique.
    Parameter name: name

     

    This one beats me. I am programming MVC in Umbraco 6.1.2 and first time the page is viewing it is showing correct when reloading the page this shows?

  • Johan 50 posts 174 karma points
    Aug 08, 2014 @ 18:24
    Johan
    0

    I have found something that suggest a solution here: http://issues.umbraco.org/issue/U4-5017

     they are talking about my controller is being executed twice and it happens sometimes with code files in the App_Code folder. I have my controller put in that App_Code folder

    Peter Flannery says:

    -"I moved it to the root of an MVC area and it seems to be working fine now. thanks for you help."

     

    But how do you move or set up an area for these MVC controllers?

     

    Maybee I shouldnt set up a new area but use the one in there for Umbraco and MVC. Were is that area being found?

  • Johan 50 posts 174 karma points
    Aug 09, 2014 @ 21:08
    Johan
    0

    I have resorted to setup a new development enviroment to sovle my problem. Now I am first creating a MVC 4 project in my Visual Studio and then importing manually all files from my previous dev location. DB I still use a MS SQL fullversion.

     

    No my question: Is there no way to develop open source code and MVC? MVC has to be inside a dll to work properly? The App_Code was great so that I could modify current enviroments and always leave documented what has been change or done. 

     

     

  • John Hildebrant 14 posts 35 karma points
    Aug 21, 2014 @ 18:25
    John Hildebrant
    0

    I solved this problem by renaming the route (the first argument in RouteTable.Routes.MapHttpRoute) in my code from "DefaultApi" to something more unique.

     

     protected override void ApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
            {
                RouteTable.Routes.MapHttpRoute(
                    "DefaultApi",
                    "Umbraco/api/{controller}/{id}",
                    defaults: new { id = System.Web.Http.RouteParameter.Optional }
                    );
    ... 
Please Sign in or register to post replies

Write your reply to:

Draft