After adding the assebly of System.Data.Entity to my web config I got this error: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. After adding the assebly of System.Data.Entity