No SPSite.Properties properties

Jan 19, 2010 at 6:46 PM


SPSite does not have a Properties property. I think your code in the download is using the properties bag of the root web instead.

The sample on the home page of this project can't work:

string propertyValue = String.Empty;
string propertyName = "ConnectionString";

using (SPSite site = new SPSite(SPContext.Current.Web.Url))
if (site.Properties.ContainsKey(propertyName))
propertyValue = site.Properties[propertyName];

You could use site.RootWeb.Properties...