I am a developer by trade so am very used to using generics and reflection in C#, however, today I was faced with trying to grab an ‘SPPersistedObject’ from the ‘SPFarm.Local.Services.GetValue<T>()’ method. So, in C# I wanted to do this : Microsoft.Practices.SharePoint.Common.Logging.DiagnosticsService msDiagnosticService = SPFarm.Local.Services.GetValue<Microsoft.Practices.SharePoint.Common.Logging.DiagnosticsService>("clbDiagnosticService"); if (msDiagnosticService != null) { ...

Read More