EnvDTE.ActiveDocument in VSIX Project
James Bendler
1
Reputation point
I'm writing a VSIX project in Visual Studio 2022 Preview.
If I try to execute this code, it fails with
System.MissingMethodException: 'Method not found: 'EnvDTE.Document EnvDTE._DTE.get_ActiveDocument()'.'
Code:
ThreadHelper.ThrowIfNotOnUIThread();
DTE dte = (DTE)MyPackage.GetGlobalService(typeof(DTE));
string name = dte.ActiveDocument.Name;
Community Center Not monitored
46,184 questions
Sign in to answer