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;
Post a Comment

Popular posts from this blog

C# - ListView Item Spacing (Padding)

IIS / ASP.NET - Run all Managed Modules for All Requests (RAMMFAR)

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