There are a couple of things you can try. First:
CREATE DATABASE Yafnet ON (NAME = 'Yafnet', FILENAME='*filepath*\Yafnet.mdf') FOR ATTACH;
If that doesn't work then try this:
Right click on SSMS and Run As Administrator. Then try to attach again. This should resolve the problem.