Skip to content

VS2015.1 RC: Crash when inline renaming model type #6821

@Suchiman

Description

@Suchiman

Stacktrace obtained from attaching VS to VS:

System.InvalidOperationException: Sequence contains no elements
   at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source)
   at Microsoft.CodeAnalysis.Editor.Implementation.InlineRename.InlineRenameSession.OpenTextBufferManager.SelectionTracking.<>c__DisplayClass5_0.<.ctor>b__0(KeyValuePair`2 kvp)
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   at Microsoft.CodeAnalysis.Editor.Implementation.InlineRename.InlineRenameSession.OpenTextBufferManager.SelectionTracking..ctor(OpenTextBufferManager openTextBufferManager)
   at Microsoft.CodeAnalysis.Editor.Implementation.InlineRename.InlineRenameSession.OpenTextBufferManager.ApplyConflictResolutionEdits(IInlineRenameReplacementInfo conflictResolution, IEnumerable`1 documents, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.Editor.Implementation.InlineRename.InlineRenameSession.ApplyReplacements(IInlineRenameReplacementInfo replacementInfo, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.Editor.Implementation.InlineRename.InlineRenameSession.<>c__DisplayClass63_0.<UpdateConflictResolutionTask>b__1(Task`1 t)
   at Roslyn.Utilities.TaskExtensions.<>c__DisplayClass4_0`1.<SafeContinueWith>b__0(Task antecedent)
   at Roslyn.Utilities.TaskExtensions.<>c__DisplayClass1_0.<SafeContinueWith>b__0(Task antecedent)
   at Roslyn.Utilities.TaskExtensions.<>c__DisplayClass5_0`1.<SafeContinueWith>b__0(Task t)

I have two files, Models.cs and EmailTemplate.cshtml (latter using RazorEngine as email templating engine) in a web Project. The EmailTemplate.cshtml has a @model SampleType directive. When both files are opened and i try to rename SampleType inside Models.cs, VS will Crash. When i close EmailTemplate.cshtml prior to starting the inline rename, VS won't Crash.

Metadata

Metadata

Assignees

Labels

4 - In ReviewA fix for the issue is submitted for review.Area-IDEBugResolution-FixedThe bug has been fixed and/or the requested behavior has been implementedUrgency-Soon

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions