共用方式為


Workspace.ApplyAnalyzerReferenceAdded(ProjectId, AnalyzerReference) 方法

定義

此方法會在 期間 TryApplyChanges(Solution) 呼叫,以將分析器參考新增至專案。

覆寫此方法以實作新增分析器參考的功能。

protected:
 virtual void ApplyAnalyzerReferenceAdded(Microsoft::CodeAnalysis::ProjectId ^ projectId, Microsoft::CodeAnalysis::Diagnostics::AnalyzerReference ^ analyzerReference);
protected virtual void ApplyAnalyzerReferenceAdded (Microsoft.CodeAnalysis.ProjectId projectId, Microsoft.CodeAnalysis.Diagnostics.AnalyzerReference analyzerReference);
abstract member ApplyAnalyzerReferenceAdded : Microsoft.CodeAnalysis.ProjectId * Microsoft.CodeAnalysis.Diagnostics.AnalyzerReference -> unit
override this.ApplyAnalyzerReferenceAdded : Microsoft.CodeAnalysis.ProjectId * Microsoft.CodeAnalysis.Diagnostics.AnalyzerReference -> unit
Protected Overridable Sub ApplyAnalyzerReferenceAdded (projectId As ProjectId, analyzerReference As AnalyzerReference)

參數

projectId
ProjectId
analyzerReference
AnalyzerReference

適用於