System.AggregateException: One or more errors occurred. —> System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: lineNumber at Microsoft.VisualStudio.Text.Implementation.SimpleStringRebuilder.GetLineFromLineNumber(Int32 lineNumber) at Microsoft.VisualStudio.Text.Implementation.TextSnapshot.GetLineFromLineNumber(Int32 lineNumber) at Microsoft.CodeAnalysis.Text.Extensions.SnapshotSourceText.LineInfo.get_Item(Int32 index) at Microsoft.CodeAnalysis.Text.TextLineCollection.GetPosition(LinePosition position) at Microsoft.CodeAnalysis.Text.TextLineCollection.GetTextSpan(LinePositionSpan span) at DevExpress.CodeRush.ContinuousTesting.UI.ViewModel.CodePreviewSyntaxData.UpdateSpans() at DevExpress.CodeRush.ContinuousTesting.UI.ViewModel.CodePreviewSyntaxData…ctor(Workspace workspace, SyntaxTree tree, SemanticModel model, IEnumerable`1 activeInfos, IEnumerable`1 infos) at DevExpress.CodeRush.ContinuousTesting.UI.ViewModel.CodePreviewViewModel.<GetData>d__24.MoveNext() — End of inner exception stack trace — at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at DevExpress.CodeRush.ContinuousTesting.UI.ViewModel.CodePreviewViewModel.ehTextBufferChanging(Object sender, TextBufferChangingEventArgs e) at System.EventHandler`1.Invoke(Object sender, TEventArgs e) at DevExpress.CodeRush.VisualStudio.TextEditor.CRTextBuffer.OnTextBufferChanging(Object editTag) at DevExpress.CodeRush.VisualStudio.TextEditor.CRTextBuffer.ehTextBufferChanging(Object sender, TextContentChangingEventArgs e) at Microsoft.VisualStudio.Text.Implementation.BaseBuffer.RaiseChangingEvent(TextContentChangingEventArgs args) —> (Inner Exception #0) System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: lineNumber at Microsoft.VisualStudio.Text.Implementation.SimpleStringRebuilder.GetLineFromLineNumber(Int32 lineNumber) at Microsoft.VisualStudio.Text.Implementation.TextSnapshot.GetLineFromLineNumber(Int32 lineNumber) at Microsoft.CodeAnalysis.Text.Extensions.SnapshotSourceText.LineInfo.get_Item(Int32 index) at Microsoft.CodeAnalysis.Text.TextLineCollection.GetPosition(LinePosition position) at Microsoft.CodeAnalysis.Text.TextLineCollection.GetTextSpan(LinePositionSpan span) at DevExpress.CodeRush.ContinuousTesting.UI.ViewModel.CodePreviewSyntaxData.UpdateSpans() at DevExpress.CodeRush.ContinuousTesting.UI.ViewModel.CodePreviewSyntaxData…ctor(Workspace workspace, SyntaxTree tree, SemanticModel model, IEnumerable`1 activeInfos, IEnumerable`1 infos) at DevExpress.CodeRush.ContinuousTesting.UI.ViewModel.CodePreviewViewModel.<GetData>d__24.MoveNext()<—
CodeRush throws an exception on code editing
Answers approved by DevExpress Support
We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.
Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.