If you are getting this error message, it's because you are trying to register an assembly as sand boxed but have it's location set to disk or GAC. This is not an allowed combination, instead if you need it to be sand boxed set the storage location to the database.