When I publish an ASP.NET WebAPI
solution to a remote IIS Server
, I get the error message:
Message: System.ArgumentException: A route named 'DefaultRoute' is already in the route collection. Route names must be unique.
I saw this thread with the same problem, but nothing on it has worked. I have tried:
Is there anyway I can find out if there is a stale file. I did rename some files and I heard that this can cause a problem?
Not sure if this matters, but I am using the ASP.NET WebApi along with RestSharp to make my rest calls.
This is what my Global.asax startup
has: Is it redundant?
AreaRegistration.RegisterAllAreas();
WebApiConfig.Register(GlobalConfiguration.Configuration);
RouteConfig.RegisterRoutes(RouteTable.Routes);
I came to similar problem with already set routes. For me the solution was here: https://stackoverflow.com/a/28503674/1496138 . Problem was I later renamed project file - old DLL files with previous name still existed in the /bin directory and automatic startup configuration run them too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With