I'm trying to add a new item to the Web property bag using the SharePoint managed client object model, but it fails to persist. I'm using the following code:
using (var context = new ClientContext("http://projectdev:82/PWA"))
{
var web = context.Web;
context.Load(web);
var allProperties = context.Web.AllProperties;
context.Load(allProperties);
context.ExecuteQuery();
if (!allProperties.FieldValues.ContainsKey(CONNECTION_STRING_KEY))
{
allProperties.FieldValues.Add(CONNECTION_STRING_KEY, "Test");
}
context.Web.Update();
context.ExecuteQuery();
}
get_fieldValues()[someProp]to read properties, but to add/set properties I must callset_item(someProp, someValue). Although I can not seeset_itemin the C# version