Rick Strahl's Weblog  

Wind, waves, code and everything in between...
.NET • C# • Markdown • WPF • All Things Web
Contact   •   Articles   •   Products   •   Support   •   Advertise
Sponsored by:
West Wind WebSurge - Rest Client and Http Load Testing for Windows

Debugger Visualizers not working in ASP.NET Medium Trust


:P
On this page:

So imagine you are running your ASP.NET application’s in medium trust and you want to access a debugger visualizer like this:

VisualizeThis

by clicking on the little search icon in the debugger tooltip, you run into a message like this:

The application you are debugging has insufficient privileges to allow the use of custom visualizers

or more visually here failing with a DataTable visualizer:

 DebuggerVisualizerAspNet

Ah yes, see the documentation. I know I should have read that one page pamphlet Microsoft ships for documentation with ASP.NET. Right.

The problem is that the application needs to run in Full trust in order to use debugger visualizers. This can be changed in Web.config by making sure that the trust key :

<system.web>
  <trust level="Full" />
</system.web
>

is set to Full trust.

DebuggerVisualizer

Debugger visualizers can come from many sources so the security environment for the visualizers is different than than main debugger and as such it requires explicit permissions to execute.

Be careful with these settings though. For production sites it’s recommended you run in Medium trust, so if you change settings in your local config file remember not to send them up to the server. Better yet, change the settings only while you need it for debugging and then set it back.

I run into this frequently because I try to set up my Web sites during development with Medium trust if I can to see all the places when and if I run into problems. So I often end up having to change that switch temporarily for debugging and then setting it back when I’m done with this task.

Posted in ASP.NET  Visual Studio  

The Voices of Reason


 

JK
September 24, 2009

# re: Debugger Visualizers not working in ASP.NET Medium Trust


I just love these short but useful bits of info that will make my job easier some day. Its a quick read too in this case. Sometimes I don't have time for a more in depth posting.

Venkat
February 13, 2011

# re: Debugger Visualizers not working in ASP.NET Medium Trust

Hi Rick,

You always my favorite while solving the ASP.Net problems

Thanks
- Venkat

West Wind  © Rick Strahl, West Wind Technologies, 2005 - 2024