<p>I get the message that the namespace can't be found when I use the code below. Where does the AccessDeniedException live?</p>

<pre><code>try { ... } 
catch (SomeKindOfException ex) 
{ 
MessageBox.Show(ex.Message); 
} 
catch (AccessDeniedException ex) 
{ 
//Do something else 
}
</code></pre>

<p>Thanks</p>

I don't think that's the exception you're looking for.  The only one with this name (that I can find) is in a Sharepoint namespace.  Try attaching the debugger and seeing exactly what the type of the thrown exception is.
The type of the exception is going to vary depending on your context.  So for example, if it's an "access denied" when trying to open a file, it could be a FileLoadException, or something similar.  If it's encountered because of Code Access Security,  it will be SecurityException.  And so on.