dotnet/project-system-tools

FrontEndBuildTableDataSource ctor / can be called before loggerService is proffered

eric62369 opened this issue · 0 comments

Currently has a workaround in the code

  • Low priority (Will be good idea to fix eventually)

FrontEndBuildTableDataSource constructor needs to use an IBuildLoggerService proxy that is provided by ProfferServicePackage.cs

If the Build Logging tool window was left open when last used in VS, the window will reappear as soon as VS is reopened.
This will cause the FrontEndBuildTableDataSource constructor to be called before the IBuildLoggerService is proffered.

Ideally there should be a way to wait to call the constructor until IBuildLoggerService is not null.

Lines 91 - 94
Currently is:

if (loggerService != null)
{
    SupportRoslynLogging = await loggerService.SupportsRoslynLoggingAsync(token);
}

Ideally should be:

Assumes.Present(loggerService);
SupportRoslynLogging = await loggerService.SupportsRoslynLoggingAsync(token);

But currently Assumes.Present(loggerService); throws an error if the loggerService is null, which happens if an IBuildLoggerService is not proffered yet.

Related to PR: #353