当WCF服务到TCP / IP时,底层提供程序在Open Entity Framework上失败

时间:2012-03-26 23:07:32

标签: wcf entity-framework-4.1 tcp-ip

我有一个MVC应用程序,可以访问连接到Entity Framework的WCF服务。

我将连接从MVC应用程序切换到WCF服务到basichttp的TCP / IP,现在我收到一个错误 - 底层提供程序在打开时失败。访问实体框架时。这个错误不会发生在basichttp上。

在IIS7.5应用程序池上运行的WCF服务设置为集成模式。

连接字符串:

<add name="lc"  
     connectionString="metadata=res://*/Lib.csdl|res://*/Lib.ssdl|res://*/Lib.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=(local);initial catalog=OB;integrated security=True;multipleactiveresultsets=True;App=EntityFramework&quot;" 
     providerName="System.Data.EntityClient" />

不确定这是否相关,但我不想仅使用sql server身份验证进行Windows身份验证。

感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

迁移到IIS会导致双跃点问题。 EntityFramework连接字符串中需要用户名和密码。或者我授予帐户应用程序池(在我的情况下为NTAUTHORITY \ NETWORK SERVICE)在sql server数据库的许可下运行,因为我不需要模拟。

此致 GM