SharePoint 2010 / MSOCAF - Call to Microsoft.SharePoint.SPItemEventProperties.OpenWeb() on Sharepoint 2010. Use Microsoft.SharePoint.SPItemEventProperties.get_Web Property instead.

If you are using the following code:
SPWeb web = properties.OpenWeb();
and are getting the following error:

Call to Microsoft.SharePoint.SPItemEventProperties.OpenWeb() on Sharepoint 2010.  Use Microsoft.SharePoint.SPItemEventProperties.get_Web Property instead.

You will need to update the code to the following, and it should remedy the error:
SPWeb web = properties.Web;

Comments

Popular posts from this blog

C# - ListView Item Spacing (Padding)

C# / SQL - Performing Distributed Transactions

IIS / ASP.NET - Disabling Compatibility Mode/View (Internet Explorer)