Ok, you're calling your library from an Action so what you can do is the following...
public
class MyLibrary
{
IServiceProvider serviceProvider;
public MyLibrary(IServiceProvider serviceProvider)
{
this.serviceProvider = serviceProvider;
DTE dte = (DTE) this.serviceProvider.GetService(typeof(DTE));
}
}
then in your action, you can provide that ServiceProvider through the Site property.
public
override void Execute()
{
MyLibrary library = new MyLibrary(this.Site);
}
hth
jose