My Visual Studio package requires the use of an EnvDTE.DTE variable, but it always gets back as null. After reading up on many hacks, all of them say to use the OnShellPrope
Try the following command:
dte = Package.GetGlobalService(typeof(DTE)) as DTE2;