我有一个静态路由,它基本上将 url 模式映射到特定的控制器操作。
routes.MapRoute(
name: "StaticRoute1", url: "getxml", defaults: new { Controller = "XmlData", Action = GetXml" });
所以网址如下:
www.example.com/getxml?id=1&size=100
应该调用 XmlDataController GetXml 方法。
它在本地运行良好,但在生产中我得到:
路由表中没有路由与提供的值匹配。
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: No route in the route table matches the supplied values.
我该如何诊断这个问题?