SInglePageApplication - DbDataController and HttpControllerConfigurationAttribute error

I am trying to work with an example from a Steve Sandersons video.

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

Much like the guy on this issue - Failed to load the HttpControllerConfigurationAttribute type after upgrading to RTF Asp.Net MVC 4. - My version works with ApiController, but I need either DbDataController or LinqToEntitiesController, however, at runtime, both causes the following:

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

I do not use HttpControllerConfigurationAttribute. Here is my code.

 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); } } } 

I know that the HttpControllerConfigurationAttribute has been removed from System.Web.Http - I do not know how to fix the problem.

What exactly (for the "mannequins" version) do I need to do to fix this problem?

+4
source share

Source: https://habr.com/ru/post/1433581/


All Articles