[RESOLVED] [VS2008] Source code is shown during errors... How can I stop it?
Hey,
Recently I had a look at the 'Debugging' options in Visual Studio 2008 and I think I may have changed some settings without realizing it.
Every time an error occurs, instead of highlighting the line with the error, VS now shows me the source code that actually throws the exception...
Example... I was trying to iterate through some files in a folder in which I (apparently) had no authorization.
vb.net Code:
For Each dir As DirectoryInfo In parentDir.GetDirectories()
Dim n As New TreeNode(dir.Name)
n.Tag = dir
parentNode.Nodes.Add(n)
'Recursive call
Me.GetFolders(dir, n)
Next
When I call this code on a particular folder, it eventually reaches a folder with limited authorization. Instead of showing me where the error occured however, I get to see this source code, in the file '__Error.cs':
csharp Code:
case Win32Native.ERROR_ACCESS_DENIED:
if (str.Length == 0)
throw new UnauthorizedAccessException(Environment.GetResourceString("UnauthorizedAccess_IODenied_NoPathName"));
else
throw new UnauthorizedAccessException(String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("UnauthorizedAccess_IODenied_Path"), str));
Now, the last line (of this example) is highlighted and the exception is shown there...
http://i39.tinypic.com/10pps1j.png
Now... This is very interesting and all, but it's rather annoying, because now I can't see on which line the error occurs exactly... In this example it's obvious, but in other cases it might not be and it becomes hard to pinpoint the location of the error...
How can I disable this? I'm sure it must be some setting, but I cannot find the one...
I saw one called 'Enable .NET Framework source stepping' was checked, and I assumed that was the one. But now I've unchecked it, and it's still doing this.
I also unchecked 'Enable address-level debugging' as that seemed a likely cause... Still, no luck.
Anyone happen to know what I did and how I can fix it? :p
Re: [VS2008] Source code is shown during errors... How can I stop it?
Go to Debug (menu) and select Exceptions - by default all "User-Unhandled" options are checked but you may have selected "Thrown".
That would be my guess of course...
Re: [VS2008] Source code is shown during errors... How can I stop it?
None of the options there are checked... Is that right or should there be options checked?
Re: [VS2008] Source code is shown during errors... How can I stop it?
That's an amusing problem for somebody ELSE to have.
I suspect that the problem is on the Options|Debugging menu, as you were headed in your initial post, though I'm not sure quite which one.
Do you have the EnableJustMyCode checked? Are either of the options under it checked?
Re: [VS2008] Source code is shown during errors... How can I stop it?
No, I did not have that option checked. I think that was the one, I checked it and now it just goes into debugging as usual again :)
Thanks!