none
"Step" fails in visual studio 2008. Can't debug RRS feed

  • Question

  • I have an excel add-in solution that uses a background worker to read some data from an excel sheet. Unfortunately, I've come to expect the occasional exception when dealing with excel, such as this invalid cast exception when trying to access a range:InvalidCastException occured

    Or this one when trying to get a cell colour:

    Return argument has an invalid type

    These exceptions happen relatively rarely, and when they occur, simply re-running the command works. Both the code segments pictured above are inside try/catch blocks, and if I don't have visual studio set to break on exceptions, everything works fine.

    However, recently when these exceptions occur, Visual Studio hangs for 5-10 seconds as it breaks on the exception. Once it returns control to me, I can't unwind from the exception like i used to be able to (The error message "The debugger cannot unwind to this frame. the attempt to unwind the callstack failed." appears), and if I try to step over/into (F10/F11), my background worker hangs, and the next line of code is never reached.

    I don't think this is an issue with my code, because if I run without breaking on handled exceptions, everything is fine. Is there some setting in Visual Studio that could cause this? I'm not aware of having changed anything.  

    Edit: I've just tried this on another machine, also running visual studio 2008, and stepping works as expected there. 
    • Edited by ForeverWintr Thursday, May 2, 2013 5:37 PM Added more information
    Thursday, May 2, 2013 5:08 PM

Answers

  • Hello,

    Thank you for your post.

    I suggest that you re-create a new and simple project and then debug it to check if the issue will occur when an exception throws.

    If you will not encounter this issue with the same scenario on another machine, I am afraid that the issue is related to your VS.

    You could locate to the IDE folder then run these commands to check if it can help:

    Please open Windows Explorer, and navigate to  <Visual Studio Installation Path>\Common7\IDE (by default is C:\Program Files \Microsoft Visual Studio 9.0\Common7\IDE);

    Devenv.exe /SafeMode: Launches the IDE in safe mode loading minimal windows.

    Devenv.exe /ResetSettings: Restores the IDE's default settings, optionally resets to the specified VSSettings file.

    Devenv.exe /ResetAddin: Removes commands and command UI associated with the specified Add-in.

    Devenv.exe /ResetSkipPkgs: Clears all SkipLoading tags added to VSPackages.

    If still no help, I suggest that you can try repairing VS or uninstalling VS completely and then install it to check the result.

    Best regards,


    Amanda Zhu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by ForeverWintr Friday, May 3, 2013 4:34 PM
    Friday, May 3, 2013 5:08 AM
    Moderator

All replies

  • Hello,

    Thank you for your post.

    I suggest that you re-create a new and simple project and then debug it to check if the issue will occur when an exception throws.

    If you will not encounter this issue with the same scenario on another machine, I am afraid that the issue is related to your VS.

    You could locate to the IDE folder then run these commands to check if it can help:

    Please open Windows Explorer, and navigate to  <Visual Studio Installation Path>\Common7\IDE (by default is C:\Program Files \Microsoft Visual Studio 9.0\Common7\IDE);

    Devenv.exe /SafeMode: Launches the IDE in safe mode loading minimal windows.

    Devenv.exe /ResetSettings: Restores the IDE's default settings, optionally resets to the specified VSSettings file.

    Devenv.exe /ResetAddin: Removes commands and command UI associated with the specified Add-in.

    Devenv.exe /ResetSkipPkgs: Clears all SkipLoading tags added to VSPackages.

    If still no help, I suggest that you can try repairing VS or uninstalling VS completely and then install it to check the result.

    Best regards,


    Amanda Zhu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by ForeverWintr Friday, May 3, 2013 4:34 PM
    Friday, May 3, 2013 5:08 AM
    Moderator
  • Hi Amanda,

    Devenv.exe /ResetSettings seems to have fixed it for me! Thank you very much!

    Interestingly, I'd already tried a complete (or so I thought) re-install of visual studio. I guess some settings file must have been left behind.

    Thanks again! :)

    Friday, May 3, 2013 4:34 PM
  • Hello,

    Glad to see this issue has been resolved and thank you for sharing your solutions & experience here. It will be very beneficial for other community members who have similar questions.

    Best regards,


    Amanda Zhu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, May 6, 2013 12:35 AM
    Moderator
  • Hi again Amanda,

    Unfortunately this issue has returned, this time in a different project (which is also an excel add-in).  Now running Devenv.exe /ResetSettings doesn't have any effect. I've also just tried the same project on a different machine, and the issue occurs there too.

    Should I start a new thread to deal with this?

    Thursday, May 9, 2013 6:37 PM
  • Hello,

    If this issue still occurs at an excel add-in in another project and even on another machine, I am afraid that the issue is related to VS.

     If re-installing VS2008 is unhelpful, since VS2008 is an old version of VS, I suggest that you create a same scenario on VS2010/VS2012 machine to check the result.

    If you can get similar issue on VS2010/VS2012, since we can’t repro it on our side, you could submit this feedback to Microsoft Connect feedback portal: http://connect.microsoft.com, Microsoft engineers will evaluate them seriously. Thanks for your understanding.

     After you submit the feedback, you can post the link here which will be beneficial for other members with the similar issue. And I will help you to vote it.

    Best regards,


    Amanda Zhu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, May 10, 2013 7:03 AM
    Moderator