Login failed for user #39;IIS APPPOOLASP.NET v4.0#39;(用户 IIS APPPOOLASP.NET v4.0 登录失败)
问题描述
我有一个 Web 项目(C# Asp.Net、EF 4、MS SQL 2008 和 IIS 7),我需要在本地将其迁移到 IIS 7(目前与 CASSINI 配合得很好).
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 中本地我有我的 Default Web Site 与我的部署.我的部署和 Default Web Site 都位于池 ASP.NET v4.0(查看图像以获取设置)上,池目标 Framework 4 作为我的 Web 项目.访问该站点时,浏览器不显示该页面,而是允许浏览器下载该页面.
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 APPPOOLASP.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.
推荐答案
您可以从 IIS7 -> 应用程序池 -> 高级设置更改 ApplicationPoolIdentity.
You can change the ApplicationPoolIdentity from IIS7 -> Application Pools -> Advanced Settings.
在 ApplicationPoolIdentity 下,您将找到本地系统.这将使您的应用程序在 NT AUTHORITYSYSTEM 下运行,默认情况下这是数据库的现有登录名.
Under ApplicationPoolIdentity you will find local system. This will make your application run under NT AUTHORITYSYSTEM, which is an existing login for the database by default.
在应用此建议之前,您应该注意并了解安全隐患.
这篇关于用户 'IIS APPPOOLASP.NET v4.0' 登录失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:用户 'IIS APPPOOLASP.NET v4.0' 登录失败
- 输入按键事件处理程序 2022-01-01
- WebMatrix WebSecurity PasswordSalt 2022-01-01
- 带有服务/守护程序应用程序的 Microsoft Graph CSharp SDK 和 OneDrive for Business - 配额方面返回 null 2022-01-01
- 在哪里可以找到使用中的C#/XML文档注释的好例子? 2022-01-01
- 良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 2022-01-01
- Web Api 中的 Swagger .netcore 3.1,使用 swagger UI 设置日期时间格式 2022-01-01
- 如何用自己压缩一个 IEnumerable 2022-01-01
- MoreLinq maxBy vs LINQ max + where 2022-01-01
- C#MongoDB使用Builders查找派生对象 2022-09-04
- C# 中多线程网络服务器的模式 2022-01-01
