ArgumentOutOfRangeException in VS

PHP Tools [?] extends Visual Studio with set of advanced features to work more efficiently with PHP code.

ArgumentOutOfRangeException in VS

Postby jorrit » April 15th, 2017, 9:40 am

When typing in PHP files of a PHP project in VS2015, it tries to evaluate the file, but of course it will show errors and warnings, because typing is in process. One of the first times this happens in a new VS session, VS always shows a message box refering to ActivityLog.xml. In the log, this is the exception made:
System.ArgumentOutOfRangeException: startIndex cannot be larger than length of string.
Parameter name: startIndex
 at System.String.Substring(Int32 startIndex, Int32 length)
 at Microsoft.Web.Editor.Text.TextProvider.GetText(Int32 position, Int32 length)
 at Microsoft.Web.Editor.Text.TextProvider.GetText(ITextRange range)
 at Microsoft.Html.Core.Artifacts.ArtifactCollection.IsDestructiveChangeForItemSeparators(IArtifact item, ISensitiveFragmentSeparatorsInfo separatorInfo, String actualRightSeparator, Int32 start, Int32 oldLength, Int32 newLength, ITextProvider oldText, ITextProvider newText)
 at Microsoft.Html.Core.Parser.Fragments.SensitiveFragmentCollection`1.IsDestructiveChangeForSeparator(ISensitiveFragmentSeparatorsInfo separatorInfo, IReadOnlyList`1 itemsInRange, Int32 start, Int32 oldLength, Int32 newLength, ITextProvider oldText, ITextProvider newText)
 at Microsoft.Html.Core.Parser.Fragments.SensitiveFragmentCollection`1.IsDestructiveChange(Int32 start, Int32 oldLength, Int32 newLength, ITextProvider oldText, ITextProvider newText)
 at Microsoft.Html.Editor.Tree.TextChangeAnalyzer.ChangeInsideArtifact(TextChangeContext change)
 at Microsoft.Html.Editor.Tree.TextChangeAnalyzer.DetermineChangeType(TextChangeContext change)
 at Microsoft.Html.Editor.Tree.TreeUpdateTask.OnTextChanges(List`1 textChanges)
 at Microsoft.Html.Editor.Tree.HtmlEditorTree.OnTextBufferChanged(Object sender, TextContentChangedEventArgs e)
 at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.RaiseEvent[TArgs](Object sender, EventHandler`1 eventHandlers, TArgs args)

It happens with every PHP project. It does not happen when working on .NET projects. The error does not seem to affect behaviour of VS or PHP Tools.
jorrit
 
Posts: 21
Joined: March 26th, 2015, 8:08 am
Location: Amsterdam

Re: ArgumentOutOfRangeException in VS

Postby Michal Brabec » April 26th, 2017, 9:07 am

Thank you for feedback.
We have investigated this issue and we suspect that it is caused by a bug in Visual Studio Web Editor.
We will consult Microsoft regarding possible solutions.
Please let us know if you encounter other issues.
Michal Brabec │ DEVSENSE s.r.o. │ @gMichalBrabecmichal.brabec@devsense.com
User avatar
Michal Brabec
 
Posts: 13
Joined: September 14th, 2016, 8:55 am


Return to PHP Tools

Who is online

Users browsing this forum: No registered users and 8 guests

cron

User Control Panel

Login

Who is online

In total there are 8 users online :: 0 registered, 0 hidden and 8 guests (based on users active over the past 5 minutes)
Most users ever online was 151 on December 6th, 2020, 7:46 am

Users browsing this forum: No registered users and 8 guests