c# - System.Web.Routing.RouteCollection and System.Web.Mvc.RouteCollectionExtensions both have same simple name of 'IgnoreRouteInternal' -


i’ve got asp.net mvc project haven't worked on in 2 months. debugging in browser works fine long don’t change code. moment modify code whatsoever, adding whitespace, error:

an exception of type 'system.notsupportedexception' occurred in entityframework.dll not handled in user code  additional information: type 'system.web.routing.routecollection+ignorerouteinternal' , type 'system.web.mvc.routecollectionextensions+ignorerouteinternal' both have same simple name of 'ignorerouteinternal' , cannot used in same model. types in given model must have unique simple names. use 'notmappedattribute' or call ignore in code first fluent api explicitly exclude property or type model. 

the exception happens on line:

var item = cards.firstordefault(s => s.name == cardname); 

the things can think of changing routing settings 1 of last things did before picked project again, far can tell normal there. other thing i’m using tortisegit , bitbucket don’t see effect have. i’ve got project similar setup has no issues.

in case have made mistake routeconfig.cs

using system; using system.web.mvc; using system.web.routing;  namespace houseofcards {     public class routeconfig     {         public static void registerroutes(routecollection routes)         {             routes.ignoreroute("{resource}.axd/{*pathinfo}");              routes.maproute(                 name: "default",                 url: "{controller}/{action}/{id}",                 defaults: new { controller = "home", action = "index", id = urlparameter.optional }             );              routes.maproute(                 name: "hello",                 url: "{controller}/{action}/{name}/{id}"                 );         }     } } 

i have no idea how resolve this, suggestions appreciated.

i facing similar issue, after 3 days of investigating , debugging managed fix it, error message tends bit misleading, because refers system.web.routing.routecollection , system.web.mvc.routecollectionextensions classes, , leads 1 think routes have it, don't, @ least in case.

in case mistakenly declared entity's navigation property icollection<controller>, entity framework getting confused classes wanted register.

so, i'd recommend searching model property or class named reserved word or class doesn't belong model , rename it.

i hope helps


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -