A route named “x” is already in the route collection. Route names must be unique. Exception with ASP.NET MVC 3

后端 未结 16 1973
难免孤独
难免孤独 2020-12-02 16:24

I\'m doing an ASP.NET MVC 3 web service and I keep getting this exception intermittently.

Stack trace:

Server Error in \'/\' Application.

A route n         


        
16条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-02 16:58

    I was manually calling AttributeRoutingHttpConfig.Start() in my Global.asax. Did not notice this auto-generated line at the top of the file which automatically calls it.

    [assembly: WebActivator.PreApplicationStartMethod(typeof(Mev.Events.Web.AttributeRoutingHttpConfig), "Start")]
    

提交回复
热议问题