I would like to know the answer to this one too. I know it has to do with the
Code Access Security, but I am not sure what exactly. I don't know if has
anything to do with developing on a machine that is not the SharePoint Server.
The temporary solution seems to be to put the Web Part assembly in the GAC.