If I use
using(SPSite site = new SPSite("http://somwewb")) { using(SPWeb web = site.OpenWeb()) { SPList lst = web.Lists["My custom list"]; lst.Title = "My custom list 2"; lst.Update(); } }
and I preview my changes in a browser, nothing happens. The same code tried on another server and there it was working. Both have december CU installed. Does anyone know what could be the reason for the code not to work on one server? I've also tried with web.AllowUnsafeUpdates = true;
Update: Standard update throught web interface works with no problem.
UPDATE AGAIN: This solves the problem: If the thread running is not in the same CultureInfo as the web language, it will not update properties.
So the solution is when you have the web open start immediately with the following line:
Thread.CurrentThread.CurrentUICulture = new CultureInfo((int)web.Language);
I found the solution here.