Yesterday I was reinstalling my project using  stsadm and I got Error “Feature ‘<id>’ is not installed in this farm, and cannot be added to this scope” on -activatefeature. Earlier commands(addsolution, deploysolutions etc.) went ok, so it was a bit weird. After some research I went to “Central Administration > Operations > Manage Farm Features” and then to EventLog and there it was – dll error! Error message said that there was an error while copying one of the dll files to the Global Assembly Cache. After the next research I found that this dll was used by some “unknown” process and that was the reason of the error. I was very suprized when I found that this “unknown” process was my VisualStudio! I closed VS and… BINGO! Installation using stsadm and -activatefeature went perfectly.

It was the first time when I had this kind of problem, though I went through the solution installation process countless times. This lessont hought me again not to fully trust message errors I get :)