aspnet / Tooling

Issue tracker and info on Visual Studio tooling for ASP.NET
Other
258 stars 124 forks source link

Argument Out of Range on Tabbing #998

Closed RandyBuchholz closed 6 years ago

RandyBuchholz commented 7 years ago

Issue

An errors occurs occasionally when tabbing in VS 2017 and .cshtml files

Error: Specified argument was out of the range of valid values. Parameter name: Length

Placing the cursor before the } and hitting tab produces capture

Description

This occurs regularly, though I am unable to reproduce it every time. Some action causes this to start, but I am not sure exactly what. It seems to be related to formatting (like ctrl k, d). Sometimes formatting will move an inner block like a @foreach, all the way to the left of the page and out of the hierarchy.

capture

Once this happens, the tabbing error begins. The error persists after closing VS and reloading the project.

mlorbetske commented 7 years ago

TFS Bug#386498

vkichline commented 7 years ago

@RandyBuchholz, your illustrations show a dotted line from the foreach to the closing brace. This isn't provided by default in Razor files. Could this be caused by an extension? Could you try turning off editing extensions (or launch vs via "devenv /safemode") and see if this goes away?

mlorbetske commented 6 years ago

This has been fixed in Visual Studio 2017.3 (which can be downloaded here).