I found the solution:
first you have to locate your last library file, you can do this by clicking Edit-preferences-advanced. it will show you the itunes media folder location. then close Itunes
open your folder and locate the last library (libraries are saved with date names, find the most recent one or the one that was last modified).
change the name of the library to today´s date following the format it already has. you will have to change the name for libraries: .itl, .xml, genius and extras.
once you have changed the name to today´s date on the 4 libraries you will have to delete all other libraries existing on the same folder or on a folder named "previous itunes libraries". it is also recommended to delete the itunes "preferences file" .dat (usually 1kb) and the "sentinel" file.
so, you will have on your itunes media folder only 4 libraries: .itl .xml genius and extras.
the next step is to click the itunes icon holding the "shift" key . itunes will ask you to either "quit, choose library or create library" click on choose library. then locate the library you just renamed with today´s date and extension .itl
done, itunes will open with the last saved version of your library. keep in mind that some changes or songs will not be present if you added any while getting the error "itunes cannot save the library file. a duplicate name has been specified" just locate the songs and add them again, if you have the option "copy files to itunes media folder when adding to library" checked. then go to file-add folder or file-and locate the songs missing on the itunes media folder.itunes saves the files on the hard drive but does not save the changes on the library.
hope this is clear enough.
Hi. This doesn't work with 10.2.2 (or previous version). In ny case, it seems like it must be some kind of strange permission issue, because when I launch iTunes as Administrator (I'm in Windows 7), it doesn't give the error. Anyway, at least under Windows 7 with version 10.2.2, the directory structure and file naming is different than described above, so that didn't work.
I suppose I could delete my entire library, and add the whole thing again. Gee, wouldn't that be convenient?