Not obvious issues in configuration of EF Code First

This post describes my own issues which I bumped into while setting up EF Code First. This is not a complete list of all possible issues and any input would be appreciated.

Connection String

In web project it may be not obvious why is database not created. The error message may tell about the null reference exception, but not about the actual one. Make sure that a user with which you’re connecting to the database has appropriate access. It may have no access if you use a default user with integrated security. In IIS 7.5 default user IIS APPPOOL\DefaultAppPool (a member of IIS_IUSRS group). The best practice here is to create a special user to login to the database and do not use integrated security.

The database is not created

Check whether a DB user is in server role dbcreator

See also




No Comments


You can leave the first : )



Leave a Reply