Wednesday, November 18, 2009

Exception calling "Update" with "0" argument(s): "The web being updated was changed by an external process."

I came across the error "The web being updated was changed by an external process." when i was debugging a sharepoint code, in which I had changed the System Master Page and Site Master Page present in the page _Layouts/ChangeSiteMasterPage.aspx of the Publishing sharepoint site.

This issue came up because, the SPWeb object was not being disposed. As a result it was becoming stale. And when we try to call the update method of the SPweb object it fails.

The best way to handle this issue is to Dispose the SPWeb Object whenever possible and re-create it once again before you go ahead with any other sharpeoint change through code.

Hope this helps some one....

1 comment:

  1. Disposing the SPWeb object(s) indeed solved the issue.

    Thanks SSM, this saved me alot of work!

    ReplyDelete