Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 97327

Omnisharp does not resolve Microsoft.Extensions.DependencyInjection

$
0
0

I am using VSCode while writing a webapi in dotnet core 3.0.100. When i try to build below code (ServiceTool.ServiceProvider is IServiceProvider)

ServiceTool.ServiceProvider.GetService<Stopwatch>();

I got following error:

error CS0308: The non-generic method 'IServiceProvider.GetService(Type)' cannot be used with type arguments

After below using definition problem is solved:

using Microsoft.Extensions.DependencyInjection;

Why vscode (omnisharp) does not suggest this using?


Viewing all articles
Browse latest Browse all 97327

Trending Articles



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