For files added to a map or a map control, AO keeps a lock on them even when they are removed from the map or map control. You can try using disconnect or even call the com release on the raster but I have had more luck using IDataset.Delete and IDataset.CanDelete in those cases rather that calls to system.io.file.delete.