After doing an in-place upgrade of SharePoint 3.0 to SharePoint Foundation 2010, you may receive this error on both your SharePoint site and the Central Administration Tool.
The cause of this problem for me was the application pools in IIS not being set properly after the upgrade.
In IIS 7.0, expand your web server and go to Application Pools.
As the picture above indicates, both the SharePoint Central Administration v3 and the SharePoint – 80 application pools are set to “No Managed Code.” They should be set to .NET Framework version 2.0.50727. Once you make the change your SharePoint sites should come up. Do note that it may take a moment for the site to display since the .Net runtime has to be spun up.