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

Troubleshooting: "startIndex cannot be larger than length of string"

Topics: User Forum
Feb 8, 2010 at 5:25 PM

I'm looking for advice on how to troubleshoot the following (taken from LastBuild.log):


<buildStep step="GenerateApiFilter">
Generating API filter for MRefBuilder...
    Last step completed in 00:00:03.9688
<buildStep step="Failed">

SHFB: Error BE0065: BUILD FAILED: startIndex cannot be larger than length of string.
Parameter name: startIndex



What is the build step after "GenerateApiFilter?" I have no idea what string it's referring to, nor the startIndex value that's being used. Any ideas on how to troubleshoot this error?



Feb 8, 2010 at 8:12 PM

It would appear to be having a problem with the API filter defined in the project.  You can try resetting it and then adding back the filtered elements to see if you can isolate what makes it fail.  It could be a bug in the way the API filter is handled.  If that's the case, I'd need a small example that demonstrates the problem.



Feb 10, 2010 at 6:34 PM

Immediately before launching MsBuild, the XML documentation files (generated during compile) for each assembly are processed. Specifically, reflection is used to find those types and members which are decorated with the attribute EditorBrowsableAttribute. Those types/members decorated with EditorBrowsableState.Never are added to an exclude list defined in the XML documentation files. A certain property had DeclaringType.FullName set to null. The property FullName is used to construct the exclude list. Because of the null, the exclude list had an invalid entry, which caused the "startIndex" error above. The invalid exclude list entry looked something like "P:.PropertyName". My guess is that MsBuild choked on trying to parse this invalid entry.

Correcting this entry fixed the problem.