Is aClass a Type instance? If so - just check it for null:
if (aClass != null && alMethSign[z].ToString().Contains(aClass.Namespace))
If somke error occurs i want the system to redirect to some other page and not show he error message.
<customErrors mode="RemoteOnly" defaultRedirect="~/Error.aspx" />
This is not working.