Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

dte.get_Properties is returning null in Visual Studio 2017 AsyncPackage

$
0
0

I am using Visual Studio 2017 and this is a Visual Studio extension using AsyncPackage. 

Although the custom property page and properties exist, dte.get_Properties returns null if the custom page is not opened first.   

        private void HandleOpenSolution(object sender = null, EventArgs e = null)
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            //The following standard page is correctly returning CSharp TextEditor properties.
            EnvDTE.Properties Test1 = dte.get_Properties("TextEditor", "CSharp");

            //The following custom page exist but 'Test2' is returning null.
            //If the custom page is opened prior to opening solution, 'Test2' returns page properties.
            EnvDTE.Properties Test2 = dte.get_Properties("Main", "Sub");
        }



innovoCAD



Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>