CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Language: HTML

Yellow Screen of Death in Medium Trust Besides Try/Catch

422 Views
Copy Code Show/Hide Line Numbers
<%@Page language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <link rel="stylesheet" type="text/css" href="../westwind.css" />
    <title>Web Connection Adminstration</title>
    <style type="text/css">
    .containercontent
    {
        padding: 10px;
    }
    li
    {
        padding: 4px;
    }
    </style>
</head>
 
<%
 
     Response.Write("Starting");
     try
     {
         System.Diagnostics.Process[] process = null;
         process = System.Diagnostics.Process.GetProcesses();
     }
     catch
     {
         Response.Write("T/C fired");
         return;
     }
     Response.Write("Made it");
%>  
</body>
</html>
by Rick Strahl
  September 28, 2009 @ 1:32pm
Tags:
Description:
Run the above code in Medium trust and you'll get a Yellow Screen of Death even though there's a T/C block wrapped around the security failure point.

Add a comment


Report Abuse
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate