Error thrown in Nuget Installation Via Extension

Topics: General
Mar 18, 2014 at 1:29 PM
Hi,

I try to install the nuget packages throug my vsextension. I have used the below code for install the nuget package.
 var componentModel = (IComponentModel)GetService(typeof(SComponentModel));
                     IVsPackageInstaller installerServices = componentModel.GetService<IVsPackageInstaller>();
                     installerServices.InstallPackage("http://packages.nuget.org", wizardproject, "jQuery", "2.1.0", false);
This code occured error in
var componentModel = (IComponentModel)GetService(typeof(SComponentModel));
GetService does not exist current context.

It need to implement the GetService() method or any other issues? Please update solution for this. If need to implement the GetService() ,please update the implementation code.

Thanks,
Abbas K