I have a wcf service hosted in a website in IIS and I seem to have this issue. In my web.config I have this:
the problem is you didn't add
debug="true|false" targetFramework="4.0"
in compilation tag.