Whenever an error is thrown in my Razor view (.cshtml), I get a yellow screen that states
The source code that generated this
unhandled exception can only be shown
when compiled in debug mode. To enable
this, please follow one of the below
steps, then request the URL:
It then says to either set the <@ Page Debug="true"> in the view or set the <compilation debug="true"> in the web.config.
I checked my web.config and the <compilation debug="true"> is already set. To exhaust other options, I tried adding it to all the web.config files in the view folders, but no change.
I also checked that the projects are being compiled as Debug and not Release. Any thoughts as to why the source code where the error is being thrown is not being displayed?
Edit: My application was updated from ASP.NET MVC 2 to MVC 3.
Apparently source errors are not displayed when the trust level is set to medium.
I forgot to remove
<trust level="medium" />from the web.config file after I was done testing in medium trust.