Login failed for user IIS APPPOOL\AppPool4.5 or APPPOOL\ASP.NET

The error ‘Login failed for user 'IIS APPPOOL\AppPool4.5’ usually occurs when you configure a new website in IIS or move an existing website to a newer version of IIS.

A simple solution to the error is to add a login to SQL Server for IIS APPPOOL\ASP.NET v4.5 and grant appropriate permission to the database.

Open SQL Server Management Studio > Right click ‘Security’ > New > Login

iis-apppool-login


In the dialog that appears, enter the app pool ‘IIS APPPOOL\AppPool4.5’ as the login name.

sqlserver-apppool

Click on OK.

Now expand Logins in SSMS and select this newly created login. Right Click > Properties. Click on User mapping and map this login to the database you want to provide access to.

Also select the appropriate roles for this user. I have selected db_datareader and db_datawriter.

usermapping

Click OK and try and browse the site again. The error should go away.




About The Author

Suprotim Agarwal
Suprotim Agarwal, Developer Technologies MVP (Microsoft Most Valuable Professional) is the founder and contributor for DevCurry, DotNetCurry and SQLServerCurry. He is the Chief Editor of a Developer Magazine called DNC Magazine. He has also authored two Books - 51 Recipes using jQuery with ASP.NET Controls. and The Absolutely Awesome jQuery CookBook.

Follow him on twitter @suprotimagarwal.

No comments: