SInglePageApplication - DbDataController和HttpControllerConfigurationAttribute错误

时间:2012-09-11 13:16:42

标签: .net-framework-version single-page-application

我正在尝试通过Steve Sandersons SPA视频中的示例。

http://channel9.msdn.com/Events/TechDays/Techdays-2012-the-Netherlands/2159

与此问题中的人很相似 - Could not load type HttpControllerConfigurationAttribute after updating to Asp.Net MVC 4 RTM - 我的版本与ApiController一起使用,但我需要DbDataController或LinqToEntitiesController,但是在运行时都会导致以下异常:

Could not load type 'System.Web.Http.Controllers.HttpControllerConfigurationAttribute' from
 assembly 'System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

我没有明确使用HttpControllerConfigurationAttribute。这是我的代码。

namespace MvcApplication5.Controllers
{
    public class DataServiceController : DbDataController<MSEnterpriseEntities> 
    {
        public IQueryable<MS_Substations> GetUtilities()
        {
            return DbContext.MS_Substations.OrderBy(x => x.SubId);
        }

        public void InsertUtility(MS_Substations utility) { InsertEntity(utility); }
        public void DeleteUtility(MS_Substations utility) { DeleteEntity(utility); }
        public void UpdateUtility(MS_Substations utility) { UpdateEntity(utility); }

    }
}

我知道HttpControllerConfigurationAttribute已从System.Web.Http中删除 - 我不知道如何解决问题。

我需要做些什么(对于傻瓜版本)来解决这个问题?

0 个答案:

没有答案