I wrote a web service in visual studio 2010, which uses some functionality in .NET 4. I have been trying to enable this on the same server as the CRM 4 version. This has created a world of pain for me.
The first thing I had to do was swap the CRM dll’s form 32 bit to 64, which you can find in the SDK.
I then had to remove practically everything from the web.config (which I wasn’t using anyway) as all the stuff it puts by default wasn’t causing errors.
I then got the error above in my main CRM website. I think the reason for this was I initially tried to install the webservice within CRM.
Which I resolved by doing the below, which I found on this forum discussion
1. Open Server Manager
2. Select Roles>Web Server (IIS)>IIS Manager>Select the Server>Applocation Pools
3. Select the appPool that your asp.net app is running under>Click on ‘Advanced Settings’ from the right hand pane.
4. Under Advanced Settings>General>Managed Pipeline Mode, select “Classic”
5. Recycle app pool and test your app.
Here are a couple of links with more information