0
votes

I've been pulling my hair out on this one.

I have a controller: ChatController of which any route I try gives me a 'The resource cannot be found' error.

The route:

   routes.MapRoute(
         "chatPage",
         "{lang}/chat/{action}",
         new { lang = "th", controller = "Chat", action = "Index" }
    );

The url: /th/chat

All my other routes (to other controllers) work fine.

I use routedebug.dll to see if my routes are set up correcty and the route is correct.

route debug mached route

Even if I delete the whole ChatController, I still get the same error. That means it does find the route but doesn't even get to the controller (usually this will give an controller not found error or something similar)

I get this on development server and IIS.

Anyone?

* Update *

I got it working by changing the routevalue from {lang}/Chat to {lang}/chat and changed my controllername accordingly (ChatController => chatController), this works... for now. Still want to know what causes this.

1
Do you have other routes setup? Please show your entire route definition table as this might be important. - Darin Dimitrov
The routedebug utility (see image above) shows the route matches the correct route when I type the route. Also, when I only set 1 route (the one described above) I get the same error. - Elger Mensonides

1 Answers

0
votes

make sure that previous routes don't match this case. comment all others routes and then try. in my computer it's works for me :)