A couple of quick checks on this:
1. Make sure you AF SDK version is at least 2.8.5 on the machine you're debugging from as the AFAnalysisService Class is only supported in v2.8.5+
2. Make sure the version of the AF SDK is the one based on .NET 4.0 and not .NET 2.0 when you're including the reference in the project
3. Make sure you're including the using statement for OSIsoft.AF.Analysis namespace in your code
Thanks Robert. My SDK version was 2.8.2, upgraded to 2.9 and worked.