This project has moved and is read-only. For the latest updates, please go here.


PropertyCommand - Length cannot be less than zero error.


If an index object has more than 1 period in it, it will produce an error stating that the parameter Length cannot be less than zero.
Changing the following if statement into a while loop fixes the issue. (PropertyCommand.cs line 197 in change set 28470)
if (delimiterIndex > propertyPath.IndexOf("[") &&
delimiterIndex < propertyPath.IndexOf("]"))
delimiterIndex = propertyPath.IndexOf(".", delimiterIndex + 1 );


johnwelch wrote Mar 2, 2009 at 5:27 PM

Can you provide an example path that causes this error? I have several test scenarios that include multiple periods that run successfully, and I can't duplicate the error.

I don't doubt that it's happening, just want to be able to repro it to ensure I'm fixing the right thing.

jsearcy wrote Mar 3, 2009 at 5:25 PM

The instance I encountered it was similar to this:


The second substring was resulting in "Connections[ftp.mydomain" rather than "Connections[]", because of the second period in the index name. Hope that helps.

wrote Mar 27, 2009 at 4:19 AM

Associated with changeset 30364.

wrote Mar 27, 2009 at 4:21 AM

johnwelch wrote Mar 27, 2009 at 7:49 PM

Ended up fixing by leaving the if but changing the next line to look for the next period after the closing bracket. That way, it saves looping through all the periods.

wrote Mar 27, 2009 at 7:49 PM

wrote Feb 14, 2013 at 9:09 PM

wrote May 16, 2013 at 11:24 AM

wrote May 16, 2013 at 11:24 AM

wrote Jun 14, 2013 at 8:21 AM