Tuesday, January 25, 2011

Could not load file or assembly 'Microsoft.SharePoint' or one of its dependencies

One fine Monday morning, I was awakened from my weekend blues by this popular SharePoint error message.

Could not load file or assembly 'Microsoft.SharePoint' or one of its dependencies. The system cannot find the file specified.

The system was working fine till Friday evening and we haven't done any deployment after that. To my surprise, the Settings.aspx and viewlsts.aspx pages were also throwing same error message.

After doing lot of hit and trials (like removing Read-Only access from the virtual directory folder etc.) methods suggested in many blogs, the error was not resolved.

Then I thoroughly observed the Virtual Directory folder and found that the web.config file is renamed to web1.config. That was the cause of error message and was renamed on Monday morning only by one of my Teammates (accidently while taking backup of the existing web.config file). We renamed the file to correct name and the system has started working fine !!!!