我试图创建一个干净的ASP.NET Web API服务,如果可能的话,不引用MVC程序集.我关注了这个博客http://www.codeproject.com/Articles/615805/Creating-a-Clean-Minimal-Footprint-ASP-NET-WebAPI 但是在Global.asax中使用这一行我还是要导入System.Web. Mvc组装.如果我将其删除,会对我的网络API服务产生影响吗?我尝试在没有它的情况下在我的本地运行我的服务,我没有遇到任何错误.
protected void Application_Start()
{
//AreaRegistration.RegisterAllAreas(); do we still need this?
WebApiConfig.Register(GlobalConfiguration.Configuration);
HandlerConfig.RegisterGlobalHandlers(GlobalConfiguration.Configuration);
FilterConfig.RegisterGlobalFilters(GlobalConfiguration.Configuration.Filters);
}
Run Code Online (Sandbox Code Playgroud)