I have a library, that has versioning enabled.
On that library is an event receiver that does stuff, on ItemUpdated :)
Ok, if the user uploads a document, and does not rename the document during the upload, everything works fine.
If the user uploads a document and renames it during the upload, the event receiver fails.
The code that fails is as follows:
SPListItem eItem = this._rootWeb.Lists["Listname"].GetItemByUniqueId(item.UniqueId);
where this._rootWeb is a web in elevated permissions, and item is the listitem that is received by the event receiver.
The error received is : Value does not fall within expected range.
Any ideas how to do this so that it will be able to find the item even if the user renamed it?
Basically I am trying to get the item the user added, in elevated privileges.