Debug problem - Source code/original difference...

Any change to my source results in the following (abbreviated) message in debug mode at the breakpoints when moused over:

"The breakpoint will not be hit. Source code is different from the original version. To allow breakpoint to be hit when sourcecode is different right click, choose 'Location' and turn on 'Allow.....'. To allow for all BP's disable the option 'Require source to exactly match...' under Tools>Options>Debugging>General"

What causes this phenom
I have none of the suggested options in the menu system or context menus
Using Beta 2 - clean install, new machine, using old code written in Beta 1/old machine


Answer this question

Debug problem - Source code/original difference...

  • Petr Melichar

    Hi.

    The problem you're running into is caused by a new feature in the compilers and debugger to keep track of checksums for source files. Using this mechanism we can tell if the source file we're displaying in the debugger matches the original file used to build the application.

    When you change a source file while debugging, and Edit and Continue is unavailable or disabled, you'll see warnings about the source not matching. Since Beta 2 we've improved the error message (no longer a Yes/No dialog, just a warning with an OK button). We've also changed the behavior so your breakpoints will no longer show this message when a source file does not match.

    To clarify what the message is asking you to do: right-click on the breakpoint in question, and you should see a Location item. On the resulting dialog you should see an override checkbox which will get rid of the message you're seeing when you hover over your breakpoints. Or you could go to Tools->Options->Debugging->General and uncheck the "Require source to exactly match..." option, which will turn off all checksum functionality in the debugger.

    Hope this helps!
    Scott Nonnenberg
    Program Manager
    Visual Studio Debugger / Visual C#
    http://blogs.msdn.com/scottno



  • Kirk_Mower

    Ah, I see what you meant by the term "VBX" now. VB Express has a pretty simplified profile applied, and it may be entirely impossible to set the options I recommended.

    Unfortunately there are no workarounds. Unless you have Edit and Continue on, changes to source while debugging will result in this message. If this is truly blocking you, my recommendation is to upgrade to Visual Studio Standard or Professional, Beta2. You should be able to install it directly beside Visual Basic Express.

    - Scott

  • Roman Uvarov

    Scott,
    Thanks for your prompt reply. I failed to mention that I am using VBX not C#. I don't get a 'Location' item right-clicking the breakpoint and I have no Debugging>General path in the Tools>Options menu ! Also, how to I confirm whether I have 'Edit and Continue' , disabled or available
    Thank you again
    Arlen

  • pvphuc

    Scott,
    Thanks for your response. I am an in-house developer at a local Frito-lay facility and we have been developing a data tracking widget for several years now (starting with VStudio 2003 and all upgrades beyond). Granted we intend to procure the RTM version of VB when next released but development continues (w/VBX beta 2 currently) We have migrated to WinXP Pro SP2 and the IDe seems to run fine with SQL Express except that when I run in debug mode with any code mods the breakpoints all reflect that the they will not be hit because the source code is different from the original. I did not have this issue with beta 1. My source code is a clean running copy/paste from a W2K Server machine (ran fine there!) Now I get this cryptic tooltip and my code doesn't 'hook' the database either so I can't even debug to debug!! Though I'm a self-taught VB (expert wannabe) I've worked around VB for ten plus years and this is the most hung I've ever gotten. I'm sort of in a time constraint here as my local facility (which happens to be the largest snackfood manufacturing facility in the world) would like to have this program 'canned' and ready to roll out on a global level in about two months. I am at a dead standstill without my debugger!!! I can't overemphasize the importance of getting over this hurdle or how much any additional support would mean.
    In another post I was informed the Debug node was unavailable in VBX beta 2 Could there be any other possible 'work-around' or will I have to dig around and scrape up a beta 1 download from somewhere and revert back (not a suitable prognosis, unfortunately!)
    Thank you in advance,
    Arlen


  • HectorC

    For anyone else having this issue - if you are trying to debug a project you converted from VS2003, try deleting your /bin and /obj folders. This resolved it for me.


  • Pushkar Modi

    Hi again.

    You probably have a profile applied which hides some things by default - when you go to Tools->Options, do you see a checkbox at the bottom left, with a label something like "Show all settings" You should be able to get to the debugger options pages by checking that option.

    You can determine if Edit and Continue is enabled by going to Tools->Options, then to the Debugging node and its Edit and Continue child page. (Once again, you'll need to show all settings here.) On that page you should see an "Enable Edit and Continue" option.

    Let me know if you have any more questions!

    Scott Nonnenberg
    Program Manager
    Visual Studio Debugger / Visual C#
    http://blogs.msdn.com/scottno



  • Jim Holmes

    I am struggling with this same issue, however I am using Team Edition and Edit/Continue is enabled.

    I have done a full build / rebuild, the project is set to Debug. This is not the first nor only issue I have had trying to get breakpoints to 'work'. I've been using VS since initial release and prior IDE based solutions before that - this is the first time I've encountered so many issues trying to get a simple breakpoint to work.


  • Debug problem - Source code/original difference...