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:
- Have the work in AnalyzerAssemblyLoader.AddDependencyLocation be lazy until the first time a load actually happens.
- Just use a no-op implementation of IAnalyzerAssemblyLoader, since at this point we don't expect to be loading analyzers at all in-process.
ProjectSystemProject.UpdateProjectAnalyzerReferences has this line:
roslyn/src/Workspaces/Core/Portable/Workspace/ProjectSystem/ProjectSystemProject.cs
Line 830 in a89e286
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: