Buildalyzer
Buildalyzer copied to clipboard
use AddToWorkspace throw Exception System.ArgumentException:The specified sequence has duplicates parameter name projectReferences[11]
AnalyzerManager manager = new AnalyzerManager(files[0]);
analyzer.AddToWorkspace(workspace);
exception message:
System.ArgumentException:The specified sequence has duplicates parameter name projectReferences[11]
在 Microsoft.CodeAnalysis.PublicContract.ThrowArgumentItemNullOrDuplicateException[T](IEnumerable1 sequence, String argumentName) 位置 /_/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Utilities/PublicContract.cs:行号 150 在 Microsoft.CodeAnalysis.ProjectInfo.Create(ProjectId id, VersionStamp version, String name, String assemblyName, String language, String filePath, String outputFilePath, CompilationOptions compilationOptions, ParseOptions parseOptions, IEnumerable
1 documents, IEnumerable1 projectReferences, IEnumerable
1 metadataReferences, IEnumerable1 analyzerReferences, IEnumerable
1 additionalDocuments, Boolean isSubmission, Type hostObjectType, String outputRefFilePath) 位置 /_/src/Workspaces/Core/Portable/Workspace/Solution/ProjectInfo.cs:行号 220
在 Buildalyzer.Workspaces.AnalyzerResultExtensions.GetProjectInfo(IAnalyzerResult analyzerResult, Workspace workspace, ProjectId projectId)
在 Buildalyzer.Workspaces.AnalyzerResultExtensions.AddToWorkspace(IAnalyzerResult analyzerResult, Workspace workspace, Boolean addProjectReferences)
Why does this happen?