in

Dot Net Mafia

Group site for developer blogs dealing with (usually) .NET, SharePoint 2013, SharePoint 2010, Office 365, SharePoint Online, and other Microsoft products, as well as some discussion of general programming related concepts.

This Blog

Syndication

Archives

Corey Roth [MVP]

A SharePoint MVP bringing you the latest time saving tips for SharePoint 2013, SharePoint 2010, Office 365, SharePoint Online, MOSS 2007, ASP.NET, LINQ, and Visual Studio 2012.

Beware of readonly files when deploying solutions

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.

Comments

No Comments

Leave a Comment

(required)  
(optional)
(required)  
Add

About CoreyRoth

Corey Roth is an Applications Architect at Infusion specializing in ECM and Search.
2012 dotnetmafia.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems