문제

I'm using a CodeFirst database for my application and built my own RoleProvider. It uses a specific Uow which I inject using Ninject. On my local machine everything works fine. On the production website I always get a "The network path was not found" when Uow is used in the Provider for the first time. All consequent request work fine. When I uncomment the usage of Uow the problem is gone too. So there must be a problem with CodeFirst databases.

I assume that the DBConnection opening is triggered when I use Uow for the first time. The RoleProvider must have a small timeout constraint giving the DB not enough time to init.

Any ideas how to solve this?

도움이 되었습니까?

해결책

I solved it:

I am using a DbContext from a class library (so no ASP.net MVC project). To auto-migrate the DB I specified the remote's IP address. As the remote site is using S1234567 names to specify its own SQL instance I got these errors.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top