Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9246479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:29:56+00:00 2026-06-18T09:29:56+00:00

Visual Studio opens source code on top of the stack when I break all

  • 0

Visual Studio opens source code on top of the stack when I “break all” while debugging; I want to keep the cursor on the document I’m currently working on, without any other document or window (e.g.: no symbols loaded) being opened.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T09:29:58+00:00Added an answer on June 18, 2026 at 9:29 am

    There is a way to stay on the current document, but that requires creating a Visual Studio add-in and a new UI command in the Debug toolbar. Credits for this answer should actually also go to openshac, who posted a similar SO question and also gave a workaround in his OP by using a macro.

    The implementation is fairly simple (it took me a few minutes to have it working). First, in the add-in project, modify the Exec method in the Connect.cs file like this:

    public void Exec(string commandName, vsCommandExecOption executeOption, ref object varIn, ref object varOut, ref bool handled)
    {
        handled = false;
        if(executeOption == vsCommandExecOption.vsCommandExecOptionDoDefault)
        {
            if(commandName == "BreakInCurrentDocument.Connect.BreakInCurrentDocument")
            {
    
                // here's where the magic happens
                // ******************************
                var activeWindow = _applicationObject.ActiveWindow;
                _applicationObject.Debugger.Break();
                if (_applicationObject.ActiveWindow != activeWindow)
                {
                    _applicationObject.ActiveWindow.Close(vsSaveChanges.vsSaveChangesNo);
                }
                // ******************************
    
                handled = true;
                return;
            }
        }
    }
    

    After creating and registering the add-in, just:

    1. click TOOLS on the Visual Studio’s menu
    2. Customize
    3. Commands
    4. Choose the “Toolbar” radio button
    5. Select “Debug”
    6. Add Command…
    7. From the “Addins” category, choose your custom add-in.

    That’s it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While working with ASP.NET using Visual Studio (2008) I have discomfort issue: source code
In Visual Studio 2010, when I open a source code file that has a
There is an open source product (code review tool for Visual Studio & TFS)
I just copied over an Visual Studio 2010 source code from one SVN repository
I downloaded source code of example written in asp.net mvc3 visual studio 2010 Open
If I do an svn update while I have Visual Studio open and a
Visual Studio (SP1) runs fine until I try and view .aspx source files with
microsoft visual studio opens my table using dataset designer but i cannot open my
I have created an open source project that runs from Visual Studio. But it
I am debugging some other programmer's source code of a Windows Media Player plugin.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.