Home » Asp.netRSS

Login failed for user 'IIS APPPOOL\ASP.NET v4.0'

 I am using VS 2010, Windows 7, SQLEXPRESS 2008 R2, ASP.NET 4.0, C#, Linq, and a web application project with a small project just to display records in a database created in  SQL Server Management Studio. If I use the VS development server it works OK. If I use the IIS server, I get the error in the Subject line. If I use the sa ID and password in the connection string, it works (I have mixed mode set up in SQLExpress). My connection string is: "Data Source=MyServer\SQLEXPRESS;Initial Catalog=Projects;Integrated Security=True". I don't want to deploy apps with an ID and password so what do I do to resolve this? I have already spent many, many hours searching for the answer to this in MSDN and have not found anything that makes any difference.

Ray Stevens

 

 

11 Answers Found

 

Answer 1

If you are using the default anonymous user  in IIS, then you should be able to log into SQL Server with integrated security.

 

Answer 2

How do I specify the "default anonymous user" when the above login  is supplied for me by the IIS APPPool?

Ray

 

 

Answer 3

How did you get this user  name for the Application Pool? 

 

Answer 4

These user  names seem to be supplied by the IIS 7.0 ApplicationPoolIdentity. I don't understand where the login  comes from and why it uses an application pool for a login. I have tried different logins in the connection string and the only one that works is the sa login. I have set mixed mode on SQLEXPRESS so it is not that. When I turn off the use of IIS by using the development web server then everything works OK but that is not what a normal web site works like. Any help with this would be greatly appreciated.

Ray

 

 

Answer 5

In IIS Manager, go to the website and in the IIS section, select the Authentication icon and open it.  You should have a list of authentications.  Right-click on Anonymous Authentication and select Edit.  I believe that this should be set to Application pool identity.  If not, then select this.

Next, go to the Application Pools and select the pool your website is in.  In the listing, you should see the Identity column.  It should be NetworkService for the pool in this column.  If not, then right-click on the pool and select Advanced Settings.  Under the Process Model section, set the Identity to NetworkService by clicking the button on the right-side of the text box and in the dialog, using the Built-in account dropdownlist.

Try your website now through IIS. 

 

Answer 6

RayStevens:
I don't want to deploy apps with an ID and password so what do I do to resolve this?

Provide the appropriate logins in SQL for the asp.net process account, in IIS 7 it's the app pool account by default.

Jeff


 

Answer 7

 I tried what you said and this is the error I get when it does the ProjectsGV.Databind(): "cannot open database "Projects" requested by the login. The login  failed. Login failed  for user  'NT AUTHORITY\NETWORK SERVICE'".

Ray

 

 

Answer 8

jeff@zina.com:

RayStevens:
I don't want to deploy apps with an ID and password so what do I do to resolve this?

Provide the appropriate logins in SQL for the asp.net process account, in IIS 7 it's the app pool account by default.

Jeff


 

What do you mean by: Provide the appropriate logins in SQL for the asp.net process account, in IIS 7. Which one do you mean, SQL or IIS 7? I am confused by your answer.

Ray

 

 
 

Answer 10

I tried everything I could in the first reference with no luck. The second reference gives me a "page not found". I have, somehow, gotten "LocalSystem" to work by selecting it in the advanced settings. I created a "SqlManagerUi" user  in the Database Properties | Permissions | Users or roles under the Projects database in SQL Server 2008 R2 Server Management Studio. This allowed LocalSysten to work but I don't know why since none of the grant check boxes seen to persist so nothing gets changed???

Ray

 

 

Answer 11

Hello

I work in a developer virtual machine AD 2008 R2 domain member with

Windows Server Enterprise 2008 R2

SQLEXPRESS bundeled with Visual Studio 2010 Ultimate Trial

SQL Management Studio R2 (64 bit)

IIS 7.5 (Framework 4.0)

 

I solved so

I created a login  in SQL Management Studio that has the exactly name displayed in the error window IIS APPPOOL\ASP.NET v4.0. After I created a user  in my database named IIS APPPOOL using that login with db_owner grant In IIS Management I assigned at my web site -> IIS Authentication -> Anonymous Authentication (right click for edit) -> Application pool identity

Good work

 

 

 
 
 

<< Previous      Next >>


Microsoft   |   Windows   |   Visual Studio   |   Follow us on Twitter