Labs > Visual Studio Extension: Hide “Break Mode” and “No Source Available” tab
This small extension will prevent the tool window with title “Break Mode” or “No Source Available” from appearing in Visual Studio, and preserve the focus on the currently active tab.
Alas, Visual Studio otherwise displays a tab stating that ‘The application is in break mode’ and that it cannot find source code to step into. This is obvious when simply pausing an idle application, therefore it forces the developer to close this window before getting back to the code he wants to modify, which may be a productivity killer.
Let’s hope this extension will be short-lived (though it has been more than 10 years now 🙂 so better not to hold your breadth) as the Visual Studio development team adds an option to better control this behavior!
This extension should work with all locales of Visual Studio.
Finding absolutely no solution/workaround despite an exhaustive digging created an immense frustration and at the same time a good reason to play with the Visual Studio Extensibility framework and accomplish the job myself :). The result is much fitter than what I could have done with AutoIT (probably an always running background loop checking for specific IDE windows through graphical pattern matching).
Feature requests are welcome here. Official GitHub repository here. Contributions are welcome.
You can install the extension from within Visual Studio directly or download the VSIX installable package from the Visual Studio Marketplace.
This is excellent, that annoying “No Source Available” screen was killing me.
Maybe I am just not VS2010 in the right way that Microsoft were expecting but this popup is very annoying.
i guess this is only working on english Versions. Tried it with German Language Visual Studio 2010 but doesn’t work.
Will check back once in a while hpoing for a int fix.
thx in advance
German support was added. Thanks for your feedback.
Oh how I wish there wasn’t a need for this addon. But THANK YOU for writing it. Lets hope one day MS acquire your app for $1,000,000 and intergrate it into VS2010 SP1
Plz add support to spanish languege.
Thx so much!
I got another solution for you all. It is a hack but its working well. I love ILSpy and reflector.
The idea is to change some values in a visual studio package. In this case, i removed a specific delegate the SolutionOpened invocation list of the package. This is preventing initialisation of the NoSourceToolWindow. If it does not listen to the debugger engine, it does not show.
Hope its helps.
private void OnBeforeLoadSolution()
{
RemoveNoSourceToolWindow();
}
private void RemoveNoSourceToolWindow()
{
var guid = new Guid(“BEB01DDF-9D2B-435B-A9E7-76557E2B6B52”);
try
{
// Remove the no soure tool window
// Get the Razor package
IVsPackage package = null;
var shell = ServiceProvider.GetService(typeof(IVsShell)) as IVsShell;
if (shell != null)
{
shell.IsPackageLoaded(ref guid, out package);
}
if (package == null)
{
shell.LoadPackage(ref guid, out package);
}
if (package != null)
{
// Get the solution opened event handler and remove the NoSourceToolWindowAdapter delegate from it.
var packageType = package.GetType();
var eventInfo = packageType.GetEvent(“SolutionOpened”);
var fieldInfo = packageType.GetField(eventInfo.Name, AllBindings);
if (fieldInfo != null)
{
var eventValue = fieldInfo.GetValue(package) as Delegate;
if (eventValue != null)
{
var list = eventValue.GetInvocationList();
foreach (var eventDelegate in list)
{
if (eventDelegate.Target == null)
continue;
var targetType = eventDelegate.Target.GetType();
if (targetType.Name == “NoSourceToolWindowAdapter”)
{
eventInfo.RemoveEventHandler(package, eventDelegate);
}
}
}
}
}
}
catch (Exception e)
{
throw e;
}
}
Thank you very much Henri for you contribution; I have rewritten the code of the extension using your idea and it is now much more robust and universal.
I have published the source code on Codeplex at the same time (see URL in my article).
Any chance you could republish this for VS 2012? I absolutely hate having to see this tab open.
Hi Yeprem, I have planned to work on this by next month (I am not using VS 2012 yet), but you can already play with the code on Codeplex and submit a patch if you would like. Someone on Visual Studio Gallery suggested only something minor is missing to make it work with VS 2012.
Hi Yeprem, I added support for Visual Studio 2012 a few days ago. Enjoy!
That is awesome. I was not even able to get time to look at the source let alone update it. Thank you for taking the time because I really miss not having to see that tab open up. By the way, I love your email notification system on this site.
After installing your fix, but now when I single step with F10 or F11 in the debugger, I do not see the source code file with the yellow-arrow marker which usually tells what source line will be executed next. Any suggestion. Thanks
Hi Musa, I have never encountered the behavior you describe. I would need more information to help you.
How may I & post to your site where it shows the vs2010 source code without pointing arrow in the gutter of source code. Can you enable the site so I may post this image of my screen, it may help, or pls advise. Or it this a issue an msdn issue, as i have not gotten feedback from msdn in 2 days? Thanks much.
WAW amazing it is!!
Thanks. Keep up the good work. 😉
Thanks.
Friggin awesome. worked!
Thanks, this is fantastic
Wow!! I have FINALLY found a way to get rid of that lame tab when I manually break!
And, LOL…yes, still using VS2010…still works for me.