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


I was getting this error while hosting my project in IIS. I was not able to connect the database. Then i fix this error like this

Step 1: Go to Application Pools

Step2 : Select the application pool which one you have used

Step 3: Change the “identity” to LocalSystem


I hope this will help to somebody.


How to host Asp.net/Asp.net MVC application in IIS 7.0 ?


If we are working on asp.net mvc project and if we have to share the project with our team member for testing then we can host the application in local machine IIS, then we can share the running application URL to our team member.


For this task we can do like this

Step 1: Open IIS using Inetmgr from run window

Step 2: make ensure that IIS is working fine.

Step 3: Open the VS 2010/2012/2013 and create the Asp.net MVC application and make ensure that application is bugs free.

Step 4: Open the Solution explore and Select the application like this below Image


Step 5:  then select the properties of application or press Alt +Enter

You will get the screen like this, then select the Web and Server as given below screen shoot



Step 6:  Click on “Create Virtual Directory”. It will create the virtual directory in IIS 7.0.

Step 7 :  Now go to the IIS 7.0 and Do like this image  as shown below


Step 8: Click on browse option as shown as above image . You will get output running on localhost  as given below image




Now you can share the above URL to your team member for testing.


I hope it will help to somebody who has not hosted the site in IIS 7.0


If you have any suggestion or good tips related with post then fell free to post the comment.




what are the Advantages of asp.net MVC ?

One of the general questions to be asked in interview, why should i use asp.net mvc instead of asp.net.

Then here is the answer for this question.

Advantage of Asp.net MVC

  1. It enables clean Separations of concerns using Model, view and Controller
  2. It enables full control over the rendered HTML
  3. It enables Test Driven Development (TDD).
  4. Easy integration with JavaScript Framework.
  5. SEO and Rest Friendly URL.
  6. No Viewstate and Postback event.
  7. Follows the stateless nature of web.
  8. Extensible and pluggable framework
  9. Support third party view engine like Nvelocity, Brail, NHaml etc.
  10. Page size is very less as compare to Asp.net
  11. No page lifecycle like web form.
  12. It has been built on top of asp.net framework hence most of the features of asp.net like Membership providers, role etc can still be used in asp.net MVC application.


Disadvantages of Asp.net MVC

  1. Learning curve will be more as compare to asp.net
  2. It does not support rapid application development. So it will take more time to develop the application as compare to asp.net.
  3. Development cost will be more.
  4. If you will write more sensitive data in UI layer using java script there might be security problem.


Advantages of asp.net

  1. Provide rapid application development (RAD)
  2. Provide rich control like Gridview, Datalist, Repeater controls etc.
  3. Learning curve will be very less.
  4. Familiar model for window form developers.

I hope it will help to somebody.