Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exception when deploying to IIS: Login failed for user 'IIS APPPOOL\DefaultAppPool'

Tags:

I'm working through some WCF examples in "Windows Communication Foundation 4 Step By Step". My resulting application runs fine as long as the service is hosted in casini. It fails when I deploy the service to local IIS. When deployed to IIS, I can browse to the svc page in IE. That works.

According to the book, page 41, the app pool account needs to be a member of the db_owner role in my database. The author suggests, after verifying the correct address of the service (already did that), checking the permissions of the app pool account.

How do I verify which account is used by the application pool hosting my WCF service? Currently using the default app pool and IIS APPPOOL\DefaultAppPool is in the db_owner role. IIS APPPOOL\ASP.NET v4.0 is also in the db_owner role.

The exception is...

System.Data.SqlClient.SqlException: Login failed for user 'IIS APPPOOL\DefaultAppPool'. 

How do I troubleshoot this issue? Thanks!

like image 275
DenaliHardtail Avatar asked Aug 02 '11 16:08

DenaliHardtail


People also ask

How do I make IIS AppPool DefaultAppPool?

Select a file or directory. Click the Locations button and make sure that you select your computer. Enter IIS AppPool\DefaultAppPool in the Enter the object names to select: text box. Click the Check Names button and click OK.

What user is ApplicationPoolIdentity?

ApplicationPoolIdentity: When a new application pool is created, IIS creates a virtual account that has the name of the new application pool and that runs the application pool worker process under this account. This is also a least-privileged account.

What is an AppPool?

An application pool defines a group of one or more worker processes, configured with common settings that serve requests to one or more applications that are assigned to that application pool.

Why application pool is getting stopped?

You should still investigate why the app pool has been stopped. Typically this means that the worker process has crashed a number of times in a short period of time. The Event Log, under the "System" category, should have info on when the faults were detected by the WAS service.


1 Answers

Solution found here:

  • Open IIS
  • double click your PC name under Connections
  • Click Application Pools
  • Select your app pool (DefaultAppPool)
  • Then under actions on the right click Advanced Settings,
    • Go to Process Model section and
    • click on Identity.
    • Now select NetworkService.
like image 78
DenaliHardtail Avatar answered Sep 20 '22 05:09

DenaliHardtail



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!