One that can get to services I've proffered in my VSIP Package.
Bill
Hi Bill,
Are you attempting to retrieve an IServiceProvider from within a VSIP
package? I've found a number of instances where I needed to query for a
particular service, only to find I didn't have an actual IServiceProvider
handy.
In these cases you might find it handy to create a static Instance property
for your package object, and a public GetService method that you can use to
retrieve a service. For example::
.....
public class SomePackage : MSVSIP.Package
{
public static SomePackage Instance = null;
public SomePackage()
{
Instance = this;
}
public new object GetService(Type serviceType)
{
return base.GetService(serviceType);
}
.........
}
Then you can just use
SomePackage.Instance.GetService(typeof(ISomeService)), to retrieve the
interface you're looking for.
Sincerely,
Ed Dore [MSFT]
This post is 'AS IS' with no warranties, and confers no rights.
Bill Foust - 28 Sep 2004 19:34 GMT
Except that the class wanting to get the services doesn't know about the
package and is in a different assembly. Otherwise, I'd agree! :)
Bill
> Hi Bill,
>
[quoted text clipped - 33 lines]
>
> This post is 'AS IS' with no warranties, and confers no rights.