nel framework si usa folder.exist,strano che ti dia errore.