用户登录失败'IIS APPPOOL \\ ASP.NET v4.0的' [英] Login failed for user 'IIS APPPOOL\ASP.NET v4.0'

查看:343
本文介绍了用户登录失败'IIS APPPOOL \\ ASP.NET v4.0的'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个web项目(C#Asp.Net,EF 4,MS SQL 2008和IIS 7),我需要将其迁移到IIS 7本地(目前工作正常卡西尼)。

I have a web project (C# Asp.Net, EF 4, MS SQL 2008 and IIS 7) and I need to migrate it to IIS 7 locally (at the moment works fine with CASSINI).

在本地IIS我有我的默认Web站点我的部署。我的两个部署和默认Web站点上池ASP.NET V4.0(用于设置视影像)作为我的web项目池的目标框架4。

当访问该网站时,浏览器不显示页面,并允许浏览器下载页面。

Locally in IIS I have my Default Web Site with my deploy. Both my deploy and Default Web Site are on pool ASP.NET v4.0 (look image for settings) the pool target Framework 4 as my web project. When visiting the site, the browser does not show the page and allow the browser to download the page instead.

我在IIS上本地运行的其他项目,他们没有问题的工作(但他们不使用实体框架)。

I have other projects running on IIS locally and they work with no problems (but they do not use Entity Framework).

使用事件记录我看到错误如下:

Using the Event Logger I see errors as below:

Exception information: 
    Exception type: EntityException 
    Exception message: The underlying provider failed on Open.
   at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure)


    Login failed for user 'IIS APPPOOL\ASP.NET v4.0'.
       at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
       at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
       at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
       at System.Data.SqlClient.SqlConnection.Open()
       at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure)

相关问题

更新:
您可以在权限必须在MS SQL 2008年被授予在这个问题上的阅读资源为手动在arift他的回答解释。
使用IIS 7.5和MS SQL 2008 R2,手动设定权限不应该是必要的。

UPDATE: You can read in the resources on this question that permissions must be granted on MS SQL 2008 manually as arift explain in his answer. Using IIS 7.5 and MS SQL 2008 R2, setting manually permission should not be necessary.

推荐答案

看起来像它的失败尝试打开到SQL Server的连接。

Looks like it's failing trying to open a connection to SQL Server.

您需要添加一个登录到SQL Server为 IIS APPPOOL \\ ASP.NET v4.0的和授予权限到数据库中。

You need to add a login to SQL Server for IIS APPPOOL\ASP.NET v4.0 and grant permissions to the database.

在SSMS中,服务器下,展开安全,然后右键单击登录,然后选择新建登录......。

In SSMS, under the server, expand Security, then right click Logins and select "New Login...".

在新的登录对话框中,输入应用程序池的登录名,然后单击确定。

In the New Login dialog, enter the app pool as the login name and click "OK".

您可以右键单击登录的应用程序池,选择属性,选择用户映射。检查相应的数据库,以及相应的角色。我想你可以只选择的db_datareader db_datawriter权限,但我认为你仍然需要授予的权限执行存储过程如果你这样做,通过EF。您可以查看详细信息的作用这里

You can then right click the login for the app pool, select Properties and select "User Mapping". Check the appropriate database, and the appropriate roles. I think you could just select db_datareader and db_datawriter, but I think you would still need to grant permissions to execute stored procedures if you do that through EF. You can check the details for the roles here.

这篇关于用户登录失败'IIS APPPOOL \\ ASP.NET v4.0的'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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