I was searching for a test project I had coded a few months ago, and could not remember in which solution I had placed it. I decided to write some quick code to get all my Visual Studio 2010 projects' c-sharp source files, and look through them for a literal I know should exist in the file.
I started in debug mode, and when my code executed this statement, I got a blue screen of death:
string[] results = System.IO.Directory.GetFiles(@"C:\Users\<user name>\Documents\Visual Studio 2010\Projects\", "*.cs", SearchOption.AllDirectories);
After a reboot, I checked the event logs, and I only saw the generic unexpected shut-down messages. I brought up the temp project, ran in debug mode again, and got the BSOD again. If I remove the SearchOption.AllDirectories param, the code doesn't break, but it doesn't get me the results I want either. But when I put it back, BSOD again.
Does anyone have any insight as to what could be causing this, or where I might be able to look (logs, etc) to see what the issue is? I did not see a kernel dump in the Windows directory, and the event log doesn't show anything that would stand out to me. FYI, I can run the same search from Windows Explorer with no errors and all the files returned.
* Update * I ran the same snippet of code but changed the file mask to *.txt, and it runs with no issue, so the .cs extension is playing into the error for some reason. Could it be having an issue listing the .cs file that I am running in debug?