I used VS2008 to create a web app and deployed it to windows server 2k8.
For WLID, I copied the expirecookie.aspx from the sample to my wlid directory.
Note: this expirecookie.aspx does not have code behind file. Instead, it has inline script.
Then when I tried to access https://mysite.com/mysite/wlid/expirecookie.aspx, it throws the error message as the subject.
Either net3.5 or the project created in VS2008 does not support the aspx file having inline script. After I added a new aspx having a code behind file in VS2008, the error went away.