If you get the above exception message from accessing your database via the Entity Framework after you’ve deployed your web application or service to IIS (7.5), it is probably because of the DefaultAppPool Identity. Changing it to LocalSystem solved this problem for me.
Here’s how you do it:
Go to the ‘Advanced Settings’ for DefaultAppPool:
In the Advanced Settings dialog, look for Identity under Process Model:
Change it to LocalSystem:
And you’re done!