GotKnowHow.com

How to Fix Login failed for user 'IIS APPPOOL\ASP.NET v4.0' error in IIS7

by


Use the Application Pool's Advance Settings to change the Built-in account for the app pools Identity.
Advanced Settings for an Application Pool in IIS7 with Process Model Identity changed to NetworkService.
IIS7 Application Pool Identity changed to NetworkService.

After running a ASP.NET website on IIS 7.5 for the first time on a Windows 7 computer, I was faced with the following error message:

Login failed for user 'IIS APPPOOL\ASP.NET v4.0'. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'IIS APPPOOL\ASP.NET v4.0'.

To fix this issue, try changing the (Process Model) Identity of your website's Application Pool to use the NetworkService account (or the less secure LocalSystem account).  By default, IIS7 seems to set the Application Pools Identity to 'ApplicationPoolIdentity', instead of NetworkService or LocalSystem. 

Here's a step-by-step guide for determining your websites Application Pool, then changing its Process Model Idenitty in IIS7: 

  1. Open Internet Information Services (IIS) Manger.
  2. In the Connections sidebar, drill down into Default Web Site and click on your website.
  3. Now in the Actions sidebar (on right side), click on Advance Settings... In the popup box, under General you will see your Application Pool listed for your website (in my case the app pool is: ASP.NET V4.0).
  4. Click Cancel...  If you choose, you can change the Application Pool here, but for the sake of this example we just wanted to find out what the website's App Pool was.

Now that we know the Application Pool that is configured for your website, we now want to change the app pool's (Process Model) Identity to 'NetworkService', here's how:

  1. Open Internet Information Services (IIS) Manger.
  2. In the Connections sidebar, click on Application Pools.
  3. Now right-click on theApplication Pool that your website is using (in this case my site is using the ASP.NET v4.0 application pool), and select Advanced Settings... from the menu.
  4. In the Advanced Settings pop-up box, locate the Process Model -> Identity section and click on the Application Pool Identity. 
  5. In the Application Pool Identity pop-up box, change the Built-in account to NetworkService (or if you want LocalSystem), then click OK, and click OK again to save your Advanced Settings changes.

After changing the Application Pool's Identity to NetworkService (or LocalSystem) you should now be able to get your ASP.NET site to run successfully on an IIS7 web server:

 


0
33

33 Comments

anonymous by René Goycochea on 6/7/2010
Thank you so much. It really helped me :) to deploy me VWD Express 2010 project.
Doug by Doug on 6/8/2010
Hey Rene... Glad the how-to helped you out!
anonymous by db112 on 6/8/2010
Thanx a lot it works
anonymous by Ok, Thank you very much on 7/30/2010
Ok, Thank you very much
anonymous by Dennis on 8/4/2010
Thanks a lot! This solves my problem!
anonymous by Deco on 9/1/2010
Brilliant, thank you
anonymous by Cagatay on 9/5/2010
thanks man you save my day
anonymous by Martin on 9/15/2010
Thank a lot, it saves time and helps solving the problem
anonymous by Tony on 9/18/2010
Great workthrough, saved me a lot of time. Thanks!
anonymous by Adil on 9/26/2010
Thanks alot.
anonymous by Andrei on 10/17/2010
Maaaaaan...!!!! I've been looking for hours to get an answer on this and I just foundd it here... really really good and helpful as well.
anonymous by Sajid on 10/27/2010
:-((((((((

I followed the above steps and now I am getting bellow error

"Login failed for user 'NT AUTHORITY\NETWORK SERVICE'. "
anonymous by Maikol on 12/9/2010
Me too!!!
It just run with LocalSystem
anonymous by vijai on 12/18/2010
Thanks yyou
anonymous by Zimbabwe [trezim] on 1/17/2011
@Sajid dont be sad. i faced the same situation today. it worked only with LocalSystem. i however found a work-around
Step1 if you are using SQL server add under DB>>SECURITY>>USERS a new user with name 'sa' & under LoginName select NT AUTHORITY\NETWORK SERVICE then under default schema choose dbo. finally select all roles
Step 2 click OK & kambooo
anonymous by Thanks! on 1/18/2011
Thanks for the clear instructions here. Keep up the good work.
anonymous by Nigeria on 3/30/2011
Thanks a lot. This really worked.
anonymous by Manivannan on 5/13/2011
Thanks dude..
anonymous by Allen on 5/18/2011
Great!!! I love you :)
anonymous by getmesar on 6/5/2011
Thanks a lot man... :)
anonymous by kris on 7/6/2011
thanks, this saved my life...
anonymous by Dan. on 7/11/2011
Jesus christ you should get a f*cking medal for posting this. THANK YOU.
anonymous by Ruhollah Moeini zadeh on 7/31/2011
Thanks, solved my problem (in windows 7 !)
anonymous by rj on 8/2/2011
thank you so much!
anonymous by Speedophile SA on 8/11/2011
Thank you so much!
anonymous by Saravanan on 9/7/2011
Thank you... It really worked!....
anonymous by Ashish on 9/14/2011
THANKS A LOT DOUG..
Doug by Doug on 9/14/2011
Absolutely, it's good to hear this solution is helping people out.
anonymous by Gil on 10/20/2011
Thanks a lot man!
anonymous by Sovik on 10/31/2011
Thank you...
A lot of thanks
anonymous by Rodney H on 11/22/2011
Great help! Thank you!
anonymous by Viktor on 11/22/2011
Thanks for the post! You've helped my team as well!
anonymous by Melih 4 weeks ago
Thank you very much.

Add your comment

by Anonymous - Already have an account? Login now!
Your Name:  

Comment:  
Enter the text you see in the image below
What do you see?
Can't read the image? View a new one.
Your comment will appear after being approved.

Ask a Question

140 characters left

Recent Articles

Follow Us...