2013-08-23 7 views
6

できるだけMVCアセンブリを参照せずにクリーンなASP.NET Web APIサービスを作成しようとしています。 私はこのブログに続いてhttp://www.codeproject.com/Articles/615805/Creating-a-Clean-Minimal-Footprint-ASP-NET-WebAPI ですが、この行はGlobal.asaxでSystem.Web.Mvcアセンブリをインポートする必要があります。削除しても私のWeb APIサービスに影響はありますか?私はそれなしで私の地元で私のサービスを実行しようとしたと私はエラーが発生しなかった。MVCを使用しない純粋なASP.NET Web APIサービスでは、Area.RegisterAllAreas()のAreaRegistration.RegisterAllAreas()がまだ必要ですか?

protected void Application_Start() 
{ 
     //AreaRegistration.RegisterAllAreas(); do we still need this? 

     WebApiConfig.Register(GlobalConfiguration.Configuration); 
     HandlerConfig.RegisterGlobalHandlers(GlobalConfiguration.Configuration); 
     FilterConfig.RegisterGlobalFilters(GlobalConfiguration.Configuration.Filters);    

} 
+1

を呼び出すする必要はありません。 – Nilesh

答えて

14

あなたはMVCエリアを使用していない場合、あなたは何の登録が必要とされないエリアを使用していない場合はAreaRegistration.RegisterAllAreas()

+0

ありがとう!ありがとう! – masterlopau