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:
Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. The connection will be closed.
notes:
- I´m using Windows 7/VS 2010/IIS 7.5/SQL Server 2008 R2 Express (all in the same machine).
- my site is using "ASP.NET v4.0" application pool;
- ASP.NET v4.0 application pool is using ApplicationPoolIdentity as Identity;
- the SQL Server 2008 R2 express has the Login "IIS APPPOOL\ASP.NETv4.0" with the server role sysadmin granted;
- the Northwind database has the user "IIS APPPOOL\ASP.NET v4.0" configured with the following permitions: db_accessadmin, db_backupoperator, db_datareader, db_datawriter, db_ddladmin, db_securityadmin;
- the w3wp.exe process is running with the user "IIS APPPOOL\ASP.NETv4.0"
- I can see that the user profile folder is created (C:\Users\ASP.NET v4.0);
- the same problem occurs using the application pool "DefaultAppPool".
If I change the ApplicationPoolIdentity user to another user that has rights to access the database it works.
Additional informations:
connection string:
<connectionStrings>
<add name="NorthwindEntities" connectionString="metadata=res://*/NorthwindModel.csdl|res://*/NorthwindModel.ssdl|res://*/NorthwindModel.msl;provider=System.Data.SqlClient;provider connection string="Data Source=NOTEBOOK\SQLEXPRESS;Initial Catalog=Northwind;Integrated Security=True;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />
</connectionStrings>
Could anyone help me to solve this issue?
Thanks in advice.