SQL 2008 + IIS应用程序池:无法生成SQL Server的用户实例因故障在检索用户的本地应用程序数据路径 [英] SQL 2008 + IIS Application Pool: Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path

查看:101
本文介绍了SQL 2008 + IIS应用程序池:无法生成SQL Server的用户实例因故障在检索用户的本地应用程序数据路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I'm 2008 R2前preSS在IIS 7.5中使用ApplicationPoolIdentity,导致以下错误消息Northwind数据库:

I´m having trouble connecting to SQL Server 2008 R2 Express with Northwind database using ApplicationPoolIdentity in IIS 7.5, resulting in the following error message:

中检索用户的本地应用程序数据路径无法生成SQL Server的用户实例因故障。该连接将被关闭。

注:


  • I'm使用Windows 7 / VS 2010 / IIS 7.5 / SQL Server 2008 R2的防爆preSS(全部在同一台机器)。

  • 我的网站使用ASP.NET v4.0的应用程序池;

  • ASP.NET v4.0的应用程序池使用ApplicationPoolIdentity身份;

  • 在SQL Server 2008 R2的前preSS有登录IIS APPPOOL \\ ASP.NETv4.0已授予服务器角色的系统管理员;

  • Northwind数据库有用户IIS APPPOOL \\ ASP.NET v4.0的具有以下permitions配置:db_accessadmin,db_backupoperator,具有db_datareader,db_datawriter权限,db_ddladmin,db_securityadmin;

  • W3wp.exe进程与用户IIS APPPOOL \\ ASP.NETv4.0跑

  • 我可以看到,用户配置文件夹中创建(C:\\用户\\ ASP.NET v4.0的);

  • 同样的问题出现在使用应用程序池默认应用。

如果我的ApplicationPoolIdentity用户更改为有权访问它的工作原理数据库中的其他用户。

If I change the ApplicationPoolIdentity user to another user that has rights to access the database it works.

其他信息:

连接字符串:

<connectionStrings>
    <add name="NorthwindEntities" connectionString="metadata=res://*/NorthwindModel.csdl|res://*/NorthwindModel.ssdl|res://*/NorthwindModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=NOTEBOOK\SQLEXPRESS;Initial Catalog=Northwind;Integrated Security=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />
</connectionStrings>

谁能帮我解决这个问题呢?

Could anyone help me to solve this issue?

谢谢意见。

推荐答案

它看起来像你试图使用SQL Server防爆preSS的的用户实例化功能,即你的连接字符串如下:

It looks like you're trying to use SQL Server Express's "user instancing" feature, i.e. your connection string looks like:


AttachDBFilename=|DataDirectory|xxxxxx.mdf;User Instance=true

这不会为<$​​ C $ C> ApplicationPoolIdentity 户口在IIS7.5工作。欲了解更多信息,请参阅此MS知识库文章:

This won't work for ApplicationPoolIdentity accounts in IIS7.5. For more information see this MS Knowledgebase article:

与SQL Server防爆preSS用户实例化和ASP.net Web应用程序项目的问题

与Visual Studio 2005内置的Web应用程序时,Visual Studio 2008,或
  Visual Studio 2010和依赖于用户实例化与SQL
  服务器前preSS 2005或SQL Server防爆preSS 2008年不工作
  新的应用程序池标识。这些产品被开发及
  对应用程序池测试了旧的网络运行
  SERVICE帐户。

Web applications built with Visual Studio 2005, Visual Studio 2008, or Visual Studio 2010 and that rely on user instancing with either SQL Server Express 2005 or SQL Server Express 2008 do not work with the new application pool identity. These products were developed and tested against application pools running with the older NETWORK SERVICE account.

此外微软劝阻现在使用此功能:

Also Microsoft discourage using this feature now:

这个功能将在微软SQL的未来版本中删除
  服务器。避免在新的开发工作该功能,并计划
  修改当前还在使用该功能的应用程序。

This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature.

如果您还没有这样做的话,我会附加数据库SQL防爆preSS和使用常规的SQL连接字符串代替,就像你在生产环境中做的。您可能需要启用TCP / IP使用SQL Server配置管理您的SQL前preSS举例来说,如果它尚未启用:

If you've not already done so, I would attach the database to SQL Express and use a regular SQL connection string instead, just like you'd do in a production environment. You may need to enable TCP/IP for your SQL Express instance using the SQL Server Configuration Manager if it's not already enabled:

和确保1433端口配置,以及对话的下一个选项卡上。

And ensure that port 1433 is configured as well on the next tab of that dialogue.

这篇关于SQL 2008 + IIS应用程序池:无法生成SQL Server的用户实例因故障在检索用户的本地应用程序数据路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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