提交 9e4d6900 编写于 作者: J Jason Malinowski

Don't fetch IVsSolutionWorkspaceService until we actually need it

上级 2100aeab
......@@ -19,13 +19,14 @@ namespace Microsoft.VisualStudio.LanguageServices.ProjectSystem
[ExportWorkspaceService(typeof(IDeferredProjectWorkspaceService)), Shared]
internal class DeferredProjectWorkspaceService : IDeferredProjectWorkspaceService
{
private readonly IVsSolutionWorkspaceService _solutionWorkspaceService;
private readonly Lazy<IVsSolutionWorkspaceService> _solutionWorkspaceService;
private readonly IVsSolution7 _solution7;
[ImportingConstructor]
public DeferredProjectWorkspaceService(SVsServiceProvider serviceProvider)
{
_solutionWorkspaceService = serviceProvider.GetService(typeof(SVsSolutionWorkspaceService)) as IVsSolutionWorkspaceService;
_solutionWorkspaceService = new Lazy<IVsSolutionWorkspaceService>(
() => (IVsSolutionWorkspaceService)serviceProvider.GetService(typeof(SVsSolutionWorkspaceService)));
_solution7 = serviceProvider.GetService(typeof(SVsSolution)) as IVsSolution7;
}
......@@ -35,7 +36,7 @@ public DeferredProjectWorkspaceService(SVsServiceProvider serviceProvider)
string solutionConfiguration,
CancellationToken cancellationToken)
{
var commandLineInfos = await _solutionWorkspaceService.GetManagedCommandLineInfoAsync(
var commandLineInfos = await _solutionWorkspaceService.Value.GetManagedCommandLineInfoAsync(
solutionConfiguration, cancellationToken).ConfigureAwait(false);
// NOTE: Anycode gives us the project references as if they were command line arguments with
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册