Problems setting up ASP.NET 4.0 web on IIS 7


.NETASP.NETASP.NETFrameworksLanguagesServers

I was attempting to set up a new ASP.NET 4.0 web on my dev machine, running Windows 7 and IIS 7. I ran into several errors, that I suspect others may encounter, and I had to search all over the web to find all the answers. So I’ve written this post in the hopes it saves some other dev the same headache I had!

So, first I created the new website and app pool identity, but when I hit the site for the first time, I got the following error:
HTTP Error 500.19 – Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.

After searching for solutions, I found most had to do with permissions to the web.config file or actual locking of sections of the web.config file. I confirmed that the app pool identity had permissions to the file, and there were no locking attributes in the file. So something else had to be the issue. Then I found this post:
http://stackoverflow.com/questions/9216158/the-requested-page-cannot-be-accessed-because-the-related-configuration-data-for
It turns out that ASP.NET had not been configured fully on my machine. So, according to one of the answers on the post, the solution is to do the following steps:
1. Open control panel
2. Click on “Programs and Features”
3. Click on ”Turn windows features on/off”
4. Locate ”Internet Information services IIS” in the pop up window and expand its node
5. Expand the ”World Wide Web Service” node
6. Expand “Application Development Features” node
7. Check the check box of”ASP.NET”
8. Then click ok button
9. You will need to restart your computer (go get a cup of coffee…)

After restarting, and hitting the site again, I got this new error:
HTTP Error 500.21 – Internal Server Error
Handler “PageHandlerFactory-Integrated” has a bad module “ManagedPipelineHandler” in its module list
Another web search revealed that even though the step above enabled ASP.NET, it was not fully installed. This article shows how to finish the installation: http://stackoverflow.com/questions/6846544/how-to-fix-handler-pagehandlerfactory-integrated-has-a-bad-module-managedpip
Basically, just open a command window and enter the command shown below (command is slightly different for 32-bit vs. 64-bit).
64-bit:
%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i

32 bit:
%windir%\Microsoft.NET\Framework\v4.0.21006\aspnet_regiis.exe -i

If you get a permissions error, you need to run the window as an administrator. To do this, go to start |run, and type ‘cmd’, but hit Ctrl-Shift-Enter, instead of just Enter.
After doing that, I hit the site again, and it worked! Hope this has helped!

Pair programming Issues


Thoughts

“Pair programming is a software development practice in which two programmers work together at one work station” http://en.wikipedia.org/wiki/Pair_programming.

pairing

I’ve worked with pair programming at just 1 company for 9 months, the results were both good and bad.

During the time when you are pairing you share your computer with another person. You also share your virtual life details, such as:

  • organization: how you organize your documents, projects, music, etc.
  • choice: which applications you use and how you use it, like: themes, hotkeys and configurations.
  • skills: typing velocity, how much you know about the application that you’re developing.

Off course, when these pairs get along with each other sharing information becomes productive.

The one billion dollar question is: “What happens when the pair does not get along?

not_pair

If both people aren’t open to learning with from the experience, the day by day can become difficult.

Pair programming doesn’t work when one party feels the result could be better if the work was done alone. In this case, pair programming is an intrusive and negative experience.

Some people doesn’t understand this situation. To make it easier to understand I usually like to compare pair programming to driving a car and having someone beside you.

First case: Going by a known path.

Imagine you’re going to a party, you’re driving your car and you know the way to go there. Beside you is someone, a friend or just an acquaintance.

If you have some doubt how to get the place or make some mistake this person can help you, suggest a better way or street.

When you arrive in the party you’ve learned something or at least both of you have had a great time together.

Second case: Learning new path.

Now, imagine you’re going to another party. Beside you is another friend or acquaintance.

During the way you ask for some help. That person helps you as best as possible.

When you arrive in the party you’ve learned a good path and both had a great experience.

Third case: The beginning of the end.

Now, imagine you’re going to a party, doesn’t matter if you know how to get there. Beside you have someone again.

You are driving but now this person prefers to do the driving. If you make some mistake that person says “It would be better if I was driving.” or “If I was driving it wouldn’t have happened.”. What would you do?

Probably both of you arrive at the party in a bad mood and will try to avoid sharing the same the car again.

Maybe if you were in the car a debate would start. But, during pair programming you’re in a company and some words wouldn’t and shouldn’t be said.

Think about it, before sharing your computer with someone.
It’s better to both if you enjoy it.

pairing

PS: Thank you Desi for reviewing this post. I’m a english learner and Desi have been helping me.
PS1: To read in portuguese click here.