1

私はここでHaacksの記事を見ています-http ://haacked.com/archive/2009/07/31/single-project-areas.aspx

サンプルをダウンロードすると、Global.ascxで次のエラーが発生します

エラー1「System.Web.Routing.RouteCollection」に「MapAreaRoute」の定義が含まれておらず、「System.Web.Routing.RouteCollection」タイプの最初の引数を受け入れる拡張メソッド「MapAreaRoute」が見つかりませんでした(ディレクティブまたはアセンブリ参照を使用しますか?)

私は明らかに何かが欠けていると思います、誰かアイデアは何ですか?

4

1 に答える 1

2

新しい実装では「AreaRegistration.RegisterAllAreas」を使用する必要があります

このブログ投稿はあなたに役立つかもしれません:

http://suhair.in/Blog/aspnet-areas-in-depth

ブログからのコードのスニペット:

protected void Application_Start()
{
     AreaRegistration.RegisterAllAreas(); 1
     RegisterRoutes(RouteTable.Routes);
}

プラス...

public static void RegisterAllAreas() 
{
      RegisterAllAreas(null);
}

public static void RegisterAllAreas(object state) 
{
                                 2                        3
      RegisterAllAreas(RouteTable.Routes, new BuildManagerWrapper(), state);
}
于 2009-11-09T10:33:52.650 に答える