The base type 'SharePointSmart404.Pages.Smart404' is not allowed for this page. The type is not registered as safe.

Jun 23, 2008 at 4:11 PM
Hi,

I tried this feature on 2 differents environements (WSS3.0 and MOSS2007) and each time I get this error message:
The base type 'SharePointSmart404.Pages.Smart404' is not allowed for this page. The type is not registered as safe. 
I'm not a SharePoint Pro Developper. Does anyone's got a solution for that please?
Jun 23, 2008 at 4:27 PM
You have to declare Smart404 as a safe control.  put the below entry in the <SafeControls> section of your app's web.config.
<SafeControl Assembly="SharepointSmart404, Version=1.0.0.0, Culture=neutral, PublicKeyToken=eaf58ff25bb059f9" Namespace="SharePointSmart404.Pages" TypeName="*" Safe="True" />
Oct 23, 2008 at 12:31 PM
You can also deploy the CAS (code acces ssecurity) update as part of the WSP.
I used to do this, but found it annoys the shit out of our server provider.
I can post samples if you want. You add a bit to the xml files.

However, I now host my aspx page with the code inline, under _layouts/myRedirects, which means no code access security.

Of course, I am also missing out on a few of the deployment automation things, but then again I do not like to connect feature receivers unless really needed.
Note, that deploying your aspx page to normal location -> loads normal masters, but deploying to /layouts, allows me to use application.master which is wicked fast. (yes, we have heavy masters, woohoo!)