“The underlying provider failed on Open” Error when using EF5 Code First with Unity IoC in Azure Worker Role against SQL Azure
问题 I am using Entity Framework 5 Code First, I use the repository and unit of work pattern, and have my domain models, repositories, and service layer working fine within an MVC app running in a Windows Azure cloud service. I'm using Unity for IoC and inject repositories, controllers, and service classes as required, and use a per-request lifetime. It has been working great. However, when I use the same code/class libraries for the domain, repository, and the EF5 DbContext, in an Azure Worker