"Operation could destabilize the runtime" error with ASP.NET Medium Trust level in Cassini on Vista

Just because this apparently is not noted anywhere within googles reach I wanted to make a note of this for the potentially frustrated:

If you're trying to run an ASP.NET app under medium trust on Vista with UAC enabled you'll probably see this exception:

System.Security.VerificationException: Operation could destabilize the runtime.

Steps to reproduce:

Create blank ASP.NET web application project. Clear web.config of anything but "<trust level="Medium" />". Do "View in Browser" on Default.aspx.

I have not been able to reproduce this on XP machines or Vista machines running with UAC disabled.

The error does not occur if you load the same website in IIS. Disabling UAC most likely also solves the problem with Cassini (still not verified).

No Comments