我想在不引用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服务中产生影响吗?我尝试在没有它的地方运行我的服务,并且没有遇到任何错误。我们是否仍然需要Global.asax中的AreaRegistration.RegisterAllAreas()在纯ASP.NET Web API服务中不使用MVC
protected void Application_Start()
{
//AreaRegistration.RegisterAllAreas(); do we still need this?
WebApiConfig.Register(GlobalConfiguration.Configuration);
HandlerConfig.RegisterGlobalHandlers(GlobalConfiguration.Configuration);
FilterConfig.RegisterGlobalFilters(GlobalConfiguration.Configuration.Filters);
}
。 – Nilesh