メイン/トップエリアに連絡先コントローラーがあり、「連絡先」という名前のエリアがあります。
トップレベルのルートを登録する前にエリアを登録すると、POST 404 が Contacts コントローラーに送信されます。
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
ModelBinders.Binders.DefaultBinder = new NullStringBinder();
RouteConfig.RegisterRoutes(RouteTable.Routes);
}
また、ルートの後にエリアを登録すると、Contacts コントローラーへの 404 はなくなりますが、Contacts エリアへのルートは 404 になります。
...コントローラー名の重複に関する質問が多数記録されていますが、領域がコントローラーと同じ名前であるという特定のシナリオは見つかりませんでした。
...おそらく簡単に修正できます。助けていただければ幸いです。:-D
fwiw、明示的な名前空間を使用して連絡先エリアを登録しています:
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 },
namespaces: new[] { "MyMvcApplication.Controllers" }
);
}