实体框架登录失败错误 [英] Entity Framework Login Failed Error

查看:100
本文介绍了实体框架登录失败错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在IIS中托管了我的WCF应用程序,并设置了4.0集成的应用程序池。我将池身份配置为网络服务。我已经检查过与此问题有关的其他职位,但无法解决。



我得到以下例外

  System.Data.Entity.Core.EntityException被用户代码未处理


HResult = -2146233087
Message =底层提供程序失败打开。
Source = EntityFramework

我尝试从网络服务修改应用程序池到本地系统,它工作正常。
任何猜测为什么在早期的情况下需要我的系统名称作为登录?

解决方案

答案:这是愚蠢的错误!我的sql server登录中没有NT AUTHORITY\NETWORK SERVICE帐户。我已经添加了所需的权限。它现在可以与我的配置的应用程序池到网络服务和集成安全=连接字符串中的true。


I have hosted my WCF application in IIS and set an app pool with 4.0 integrated. I configured the pool identity as network service. I have already checked other posts related to this issue but could not resolve it.

I get the below exception

System.Data.Entity.Core.EntityException was unhandled by user code


HResult=-2146233087
  Message=The underlying provider failed on Open.
  Source=EntityFramework

I tried modifying app pool to localsystem from network service, it works fine. Any guess why it takes my system name as login in the earlier case?

解决方案

Answer: It was stupid mistake!! There was no NT AUTHORITY\NETWORK SERVICE account in my sql server logins. I have added it with required permissions. It now works with my configuration of app pool to Network service and Integrated security=true in connection string.

这篇关于实体框架登录失败错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆