Bug 1304 - Find in Files doesn't work
Summary: Find in Files doesn't work
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: General ()
Version: Trunk
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2011-10-06 09:34 UTC by Akshay
Modified: 2011-11-15 14:34 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Akshay 2011-10-06 09:34:34 UTC
This may or may not be related to Bug 1135 (http://bugzilla.xamarin.com/show_bug.cgi?id=1135). In the latest MD (2.8) Find in Files no longer works. You either receive "The search could not be finished: length" or the message reported in 1135: "No solution open."
Comment 1 Mikayla Hutchinson [MSFT] 2011-10-06 09:40:17 UTC
No idea about the first error, could you get the full exception from the MD log file?

Regarding the second, it seem that 43adfcf82f9755bf3b1bcd4369d382677b2bc5c9 was not backported to the 2.8 branch.
Comment 2 Akshay 2011-10-06 09:42:39 UTC
Error - 9:45:20 AM - Error while search
System.ArgumentException: length
  at System.Array.Copy (System.Array sourceArray, Int32 sourceIndex, System.Array destinationArray, Int32 destinationIndex, Int32 length) [0x00000] in <filename unknown>:0 
  at System.IO.StreamReader.Read (System.Char[] buffer, Int32 index, Int32 count) [0x00000] in <filename unknown>:0 
  at System.IO.StreamReader.ReadToEnd () [0x00000] in <filename unknown>:0 
  at MonoDevelop.Ide.FindInFiles.FileProvider.BeginReplace () [0x00015] in /private/tmp/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FileProvider.cs:109 
  at MonoDevelop.Ide.FindInFiles.FindReplace+<FindAll>c__IteratorA.MoveNext () [0x0016e] in /private/tmp/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindReplace.cs:94 
  at MonoDevelop.Ide.FindInFiles.FindInFilesDialog.SearchReplace (System.String replacePattern) [0x001d0] in /private/tmp/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs:577
Comment 3 Mikayla Hutchinson [MSFT] 2011-10-06 09:51:58 UTC
Do you perhaps have a really huge file in your project?
Comment 4 Akshay 2011-10-06 09:58:02 UTC
Not particularly. I think the largest code file is just over 1200 lines of code, so not very big.

Also the first issue with the length only shows up when I do a Search in whole Solution, so perhaps something else is large in the other projects (3rd party), but this never caused a problem until the recent 2.8 version.

When I perform a Search in Project I get the issue mentioned in Bug 1135.

Update of MD was performed yesterday afternoon EDT (if there was an update to MD made, though I haven't seen that yet).
Comment 5 Mikayla Hutchinson [MSFT] 2011-10-06 10:28:37 UTC
Do you have searching of binary files enabled?

There's an icon inside the filter textbox, on the left side. It's invisible in MD 2.8 (fixed in master) but you should be able to find it be the place where the mouse cursor changes. Click on that, and you'll get a menu, where you can enable/disable searching binary files.
Comment 6 Akshay 2011-10-06 10:46:40 UTC
Took a bit, but I found the area to click. Both Include binary files and Include hidden files and directories are unchecked, so it isn't that.
Comment 7 Mikayla Hutchinson [MSFT] 2011-10-06 11:08:00 UTC
Dunno how that exception could happen then. I think we need to make MD handle errors in Find in Files better - report the file affected by the error, and continue searching.
Comment 8 Mike Krüger 2011-11-15 14:34:14 UTC
already fixed.