question

anhuacai-3049 avatar image
0 Votes"
anhuacai-3049 asked PengGe-MSFT commented

Visual Studio 2019 Index was outside the bounds of the array.

119611-image.png



System.IndexOutOfRangeException : Index was outside the bounds of the array.
at System.Collections.Generic.Dictionary`2.Insert(TKey key,TValue value,Boolean add)
at Microsoft.CodeAnalysis.CSharp.Symbols.Retargeting.RetargetingModuleSymbol.SetReferences(ModuleReferences`1 moduleReferences,SourceAssemblySymbol originatingSourceAssemblyDebugOnly)
at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.ReferenceManager.SetupReferencesForRetargetingAssembly(BoundInputAssembly[] bindingResult,BoundInputAssembly& currentBindingResult,Dictionary`2& missingAssemblies,SourceAssemblySymbol sourceAssemblyDebugOnly)
at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.ReferenceManager.InitializeNewSymbols(List`1 newSymbols,SourceAssemblySymbol sourceAssembly,ImmutableArray`1 assemblies,BoundInputAssembly[] bindingResult,Dictionary`2 missingAssemblies)
at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.ReferenceManager.CreateAndSetSourceAssemblyFullBind(CSharpCompilation compilation)
at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.ReferenceManager.CreateSourceAssemblyForCompilation(CSharpCompilation compilation)
at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.get_CommonAssembly()
at Microsoft.CodeAnalysis.SolutionState.UnrootedSymbolSet.Create(Compilation compilation)
at Microsoft.CodeAnalysis.SolutionState.CompilationTracker.FinalState.Create(ValueSource`1 finalCompilationSource,ValueSource`1 compilationWithoutGeneratedFilesSource,Compilation compilationWithoutGeneratedFiles,Boolean hasSuccessfullyLoaded,TextDocumentStates`1 generatedDocuments,Compilation finalCompilation,ProjectId projectId,Dictionary`2 metadataReferenceToProjectId)
at async Microsoft.CodeAnalysis.SolutionState.CompilationTracker.FinalizeCompilationAsync(<Unknown Parameters>)
at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
at async Microsoft.CodeAnalysis.SolutionState.CompilationTracker.GetOrBuildCompilationInfoAsync(<Unknown Parameters>)
at async Microsoft.CodeAnalysis.SolutionState.CompilationTracker.GetCompilationSlowAsync(<Unknown Parameters>)
at async Microsoft.CodeAnalysis.Document.GetSemanticModelAsync(<Unknown Parameters>)
at async Microsoft.CodeAnalysis.Shared.Extensions.DocumentExtensions.GetRequiredSemanticModelAsync(<Unknown Parameters>)
at System.Threading.Tasks.ValueTask`1.get_Result()
at async Microsoft.CodeAnalysis.CSharp.ImplementInterface.AbstractChangeImplementionCodeRefactoringProvider.ComputeRefactoringsAsync(<Unknown Parameters>)
at async Microsoft.CodeAnalysis.CodeRefactorings.CodeRefactoringService.GetRefactoringFromProviderAsync(<Unknown Parameters>)


I want to know if there is any method to avoid this alert, when I open a file in the visual studio, there always popup some error message ,tell me that Index was outside the bounds of the array.What should I do to solve this problem. Is any good ideas?

vs-general
image.png (260.3 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi, @anhuacai-3049
May I know whether your issue has been solved or not? If not, please share it in here. We can work together to figure it out.

0 Votes 0 ·
Viorel-1 avatar image
0 Votes"
Viorel-1 answered

Probably you can press the “Enable and ignore future errors” button.

You can also report this issue using HELP menu, Send Feedback, Report a Problem. This seems to be an issue of Visual Studio.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

PengGe-MSFT avatar image
0 Votes"
PengGe-MSFT answered

Hi, @anhuacai-3049

Welcome to Microsoft Q&A!

I cannot reproduce your issue.

You can try to repair Visual Studio, use devenv.exe /safemode command to start Visual Studio.

If the problem persists, I suggest you directly suggest this feature to Visual Studio Product Team in our Developer Community, and if you do suggest this feature, please share the link here, other forum members, who are interested or needed this feature will go to vote for this thread.

Sincerely,
Peng


If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.