Skip to content

ProjectSystemProject.UpdateProjectAnalyzerReferences is causing I/O under a lock #79016

@jasonmalinowski

Description

@jasonmalinowski

ProjectSystemProject.UpdateProjectAnalyzerReferences has this line:

initialReferenceList.Add(new AnalyzerFileReference(analyzer, sharedShadowCopyLoader));

The constructor for AnalyzerFileReference calls IAnalyzerAssemblyLoader.AddDependencyLocation, which does a bunch of I/O to read the assembly from disk to check its assembly name. This is happening under the main workspace lock which can slow things down during solution load. I see a few possible fixes:

  1. Have the work in AnalyzerAssemblyLoader.AddDependencyLocation be lazy until the first time a load actually happens.
  2. Just use a no-op implementation of IAnalyzerAssemblyLoader, since at this point we don't expect to be loading analyzers at all in-process.

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions