Results 1 to 5 of 5

Thread: [RESOLVED] [VS2008] Source code is shown during errors... How can I stop it?

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,070

    Resolved [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:
    1. For Each dir As DirectoryInfo In parentDir.GetDirectories()
    2.             Dim n As New TreeNode(dir.Name)
    3.             n.Tag = dir
    4.             parentNode.Nodes.Add(n)
    5.  
    6.             'Recursive call
    7.             Me.GetFolders(dir, n)
    8.         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:
    1. case Win32Native.ERROR_ACCESS_DENIED:
    2.                 if (str.Length == 0)
    3.                     throw new UnauthorizedAccessException(Environment.GetResourceString("UnauthorizedAccess_IODenied_NoPathName"));
    4.                 else
    5.                     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...


    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?

  2. #2

  3. #3

  4. #4
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    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?
    My usual boring signature: Nothing

  5. #5

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width