I'm uploading files to a document library in SharePoint 2010 by using the Add method of a SPFolder.Files object (http://msdn.microsoft.com/en-us/library/ms472956.aspx). This worked fine, until someone made a template out of an existing library (where this is still working) and created a new library out of the template.
On this new libary the Add call still finishes without exception but does return an SPFile object with Items property == null.
In the SharePoint UI the file does not show in the library, but when I connect to the library via Microsoft Explorer it's there.
I have the impression that the file is created but no item is created. Does anyone know this problem? Are there solutions?
Ok, I found the problem and a solution (more or less):
This happens only, if versioning was activated in the library the template was created from. It happens in libraries that are created from this template.
To solve it, I had to deactivate the versioning in the new library and activate it again. After this all missing files appeared and the Add method works fine, again.
Does anybody know if this is a known bug in 2010 and if there is a hotfix?
EDIT: Answer yes, this was a known bug and it was fixed in the december 2010 cumulative update (I rechecked with cu feb 2011 and couldn't reproduce it anymore).