Quantcast
Channel: Visual Studio and Visual Web Developer Express
Viewing all articles
Browse latest Browse all 3509

'IServiceProvider' does not contain a definition for 'GlobalProvider' and no extension method 'GlobalProvider' accepting a first argument of type 'IServiceProvider'

$
0
0

I'm new to C#. Please help me with the following code

using EnvDTE;

DTE dte = (DTE)ServiceProvider.GlobalProvider.GetService(typeof(DTE));
Project project = dte.ActiveDocument.ProjectItem.ContainingProject;

But I get the error 'IServiceProvider' does not contain a definition for 'GlobalProvider' and no extension method 'GlobalProvider' accepting a first argument of type 'IServiceProvider'.

I could not figure out the reason for this error. Please let me know the cause of the error.


Viewing all articles
Browse latest Browse all 3509

Trending Articles



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