Buildalyzer icon indicating copy to clipboard operation
Buildalyzer copied to clipboard

use AddToWorkspace throw Exception System.ArgumentException:The specified sequence has duplicates parameter name projectReferences[11]

Open benxionghu opened this issue 3 years ago • 0 comments

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, IEnumerable1 documents, IEnumerable1 projectReferences, IEnumerable1 metadataReferences, IEnumerable1 analyzerReferences, IEnumerable1 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?

benxionghu avatar Jun 02 '21 08:06 benxionghu