1

我创建了一个 WCF 服务,因为我正在使用 Sql 服务器位于另一个系统中的实体框架。我创建了一个 Web 应用程序并使用该服务,并且我对实体框架没有任何问题。当我在 IIS 中托管我的 Web 服务时,我的实体框架中出现异常,说底层提供程序在打开时失败。我戴上眼镜,但没有任何效果。

4

1 回答 1

0

正如人们在尝试登录 sql server 时提到的 IIS 用户网络服务用户凭据。因此,只需更改 IIS 中的应用程序池设置。

Step 1:
Open Internet Information Service Manager
Step 2:
Click on Application Pools in left navigation tree.
Step 3:
Select your version Pool. In my case, I am using ASP .Net v4.0. If you dont have this version, select DefaultAppPool.
Step 4:
Right click on step 3, and select advanced settings.
Step 5:
Select Identity in properties window and click the button to change the value.
Step 6:
Select Local System in Built-in accounts combo box and click ok.
That's it. Now run your application. Everything works well.

还要检查这个:

http://stack247.wordpress.com/2011/03/02/entity-framework-exception-the-underlying-provider-failed-on-open/

http://stack247.wordpress.com/2011/03/07/wcf-exception-in-iis-only-the-underlying-provider-failed-on-open-access-to-entity-framework/

于 2013-04-05T05:06:11.030 回答