Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collection was modified in SdkResolverService.ResolveSdkUsingResolversWithPatternsFirst #45168

Closed
KirillOsenkov opened this issue Nov 27, 2024 · 1 comment
Labels
Area-SdkResolvers untriaged Request triage from a team member

Comments

@KirillOsenkov
Copy link
Member

System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
   at bool System.Collections.Generic.List<T>+Enumerator.MoveNextRare()
   at SdkResult Microsoft.Build.BackEnd.SdkResolution.SdkResolverService.ResolveSdkUsingResolversWithPatternsFirst(int submissionId, SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, string solutionPath, string projectPath, bool interactive, bool isRunningInVisualStudio, bool failOnUnresolvedSdk)
   at SdkResult Microsoft.Build.BackEnd.SdkResolution.CachingSdkResolverService.ResolveSdk(int submissionId, SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, string solutionPath, string projectPath, bool interactive, bool isRunningInVisualStudio, bool failOnUnresolvedSdk)
   at void Microsoft.Build.Evaluation.Evaluator<P, I, M, D>.ExpandAndLoadImportsFromUnescapedImportExpressionConditioned(string directoryOfImportingFile, ProjectImportElement importElement, out List<ProjectRootElement> projects, out SdkResult sdkResult)
   at List<ProjectRootElement> Microsoft.Build.Evaluation.Evaluator<P, I, M, D>.ExpandAndLoadImports(string directoryOfImportingFile, ProjectImportElement importElement, out SdkResult sdkResult)
   at void Microsoft.Build.Evaluation.Evaluator<P, I, M, D>.EvaluateImportElement(string directoryOfImportingFile, ProjectImportElement importElement)
   at void Microsoft.Build.Evaluation.Evaluator<P, I, M, D>.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
   at void Microsoft.Build.Evaluation.Evaluator<P, I, M, D>.Evaluate() x 2
   at void Microsoft.Build.Evaluation.Project+ProjectImpl.Reevaluate(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
   at void Microsoft.Build.Evaluation.Project+ProjectImpl.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext) x 2
   at void Microsoft.Build.Evaluation.Project+ProjectImpl.Initialize(IDictionary<string, string> globalProperties, string toolsVersion, string subToolsetVersion, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext, bool interactive)
   at new Microsoft.Build.Evaluation.Project(string projectFile, IDictionary<string, string> globalProperties, string toolsVersion, string subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext, IDirectoryCacheFactory directoryCacheFactory, bool interactive)
   at Project Microsoft.Build.Evaluation.Project.FromFile(string file, ProjectOptions options)

just randomly saw this during project evaluation

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-SdkResolvers untriaged Request triage from a team member labels Nov 27, 2024
@KirillOsenkov
Copy link
Member Author

Oops, looks like it's an MSBuild issue:
dotnet/msbuild#11043

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-SdkResolvers untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

1 participant