Developed an ASP.NET mvc application and ready to publish. Now steps anyone would have generally followed :-
1. Create an new application pool "AccountingAppPool" with ".NET Framework version" as v4.0.30319
2. Assign "Identity" as "NetworkService"
3. Publish the web application to http://localhost/Accounting/
4. Assign application pool as "AccountingAppPool"
5. Now check web.config
for connection string
6. using SQL server management studio connect to database. Add "NT AUTHORITY\NETWORK SERVICE" to logins to allow access for the identity of application pool
7. All done just run the application
Now a very disappointing error
"The SELECT permission was denied on the object 'account', database 'accounting', schema 'dbo'"
User is able to connect to database but does not have access. Ok now this is frustrating. Having spent hours thinking why this is not working.
Finally after a lot of help, found the issue is actually because of impersonation.
Now modified web.config to :-
Hurray! it worked.
To have no errors
Would be life without meaning
No struggle, no joy
~Brian M. Porter, 1998
1. Create an new application pool "AccountingAppPool" with ".NET Framework version" as v4.0.30319
2. Assign "Identity" as "NetworkService"
3. Publish the web application to http://localhost/Accounting/
4. Assign application pool as "AccountingAppPool"
5. Now check web.config
for connection string
..... .....
6. using SQL server management studio connect to database. Add "NT AUTHORITY\NETWORK SERVICE" to logins to allow access for the identity of application pool
7. All done just run the application
Now a very disappointing error
"The SELECT permission was denied on the object 'account', database 'accounting', schema 'dbo'"
User is able to connect to database but does not have access. Ok now this is frustrating. Having spent hours thinking why this is not working.
Finally after a lot of help, found the issue is actually because of impersonation.
Now modified web.config to :-
Hurray! it worked.
To have no errors
Would be life without meaning
No struggle, no joy
~Brian M. Porter, 1998