Beware of readonly files when deploying solutions

Posted Friday, February 1, 2008 9:16 AM by CoreyRoth

Sometimes when I am developing a feature that is deployed via solution, after I have deployed it to the server a few times, sometimes I think it is a good idea to just copy out my feature manually to the features folder.  I've got to get out ofthe habit of doing this, because it leads to nothing good.  If you keep files in source control, more than likely one of them might be marked as readonly.  Later when you deploy your solution file again, it will say the feature installed, but more than likely you will see a message like the following.

Executing solution-deployment-mysolution.wsp-0.  The solution-deployment-mysolution.wsp-0 job completed successfully, but could not be properly cleaned up.  This job may execute again on this server.
Operation completed successfully.

What this should really read is, "Something really screwed up while installing your deployment solution, but we're not going to tell you what it is and just make you think everything went fine."  Ok, admittedly this doesnt always mean something is messed up, but in this case, something definitely was.  I went back to my SharePoint site, and could not find my feature anywhere.  I tried retracting and deploying the solution and still nothing.

This meant is was clearly time to go sifting through logs.  It was then when I saw an excpetion that the solution could not copy a file because it was readonly.  To fix it, I retracted the solution and I also manually ran uninstallfeature using stsadm to make sure the features weren't registered in SharePoint.  I then physically deleted the feature folder in question from the SharePoint features folder and reinstalled the solution.

The lesson to be learned here is don't take shortcuts when developing and deploying features or if you do, make sure nothing is readonly or it will cause problems later.

Filed under: , ,

Comments

No Comments

Leave a Comment

(required)
(required)
(optional)
(required)