I have an event receiver which is on about version 15000000, and I really thought I'd nailed it this time.
Then a user broke it again.
When the document is uploaded to the library it is tagged with some metadata based on the folder it gets inserted to. All well and good, except when the document already has this metadata inside it because someone has copied it out of SharePoint, made some changes to create a new document, then uploaded it to a different folder.
My code overrides the ItemAdding event, and sets the "AfterProperties" to the appropriate values, but SharePoint appears to completely ignore this after its finished with my code when the document being uploaded already has these properties in it.
Can anyone think of a way for this to be solved?