This is a common error to get after migration to EPiServer 5 and happens when you do the migration itself on a machine running IIS7, because the migration will make your web.config configured for IIS7, then when you take it to your developing machine that is running IIS6 you’ll get this error. What you need to do is take away the IIS7 settings and implement the IIS6 ones. Biggest difference is that IIS6 uses <system.web>(Integrated mode) and IIS6 uses <system.webserver>(Classic mode).
The examples are taken from the EPiServer documentation and you can read more about this issue there.
Easiest way for you to fix this is to simply install a new EPiServer 5 solution on your machine that is running IIS6, copy the web.config and add your specific changes to that web.config.