我在.NET 4.5中有一个MVC站点,如果我导航到Home /(入口点),一切都很好。
在我的RouteConfig.cs文件中,我有
SELECT
c.*,
u.name,
u.last_name,
COUNT(mc.user_id) AS count_students
FROM courses c
LEFT JOIN users u
ON c.user_id = u.user_id
LEFT JOIN my_courses mc
ON c.course_id = mc.course_id
WHERE c.course_id = '6'
GROUP BY
<columns not in the aggregate function>
在我的控制器中,我有这个方法
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
如果我指向/ Home,一切都很好,但如果我尝试导航到/ Home / Index,我会收到错误消息“发生错误!”
事件日志中没有更多有用的信息和错误。
请注意,通过Visual Studio,一切正常,只有当我将其部署到测试服务器时才遇到此错误。