Labs > Visual Studio Extension: Hide “No Source Available” tab

This small extension will prevent the tool window with title “No Source Available” from appearing in Visual Studio, and preserve the focus on the currently active tab.

Alas, along with brilliant features such as IntelliTrace, Visual Studio otherwise displays a tab stating that it cannot find source code where 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.

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).

Let’s hope this extension will be short-term lived as the Visual Studio development team adds an option to better control this behavior!

This extension should work with all locales of Visual Studio.

Feature requests are welcome here. Official repository here.

You can download the VSIX package directly in the Visual Studio Gallery.

  • Facebook
  • Twitter
  • LinkedIn

17 commentaires à l'article “Visual Studio Extension: Hide “No Source Available” tab”

  1. Saurus
    25 novembre 2010 | 23:13

    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.

  2. johann
    10 décembre 2010 | 21:33

    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

  3. 11 décembre 2010 | 0:40

    German support was added. Thanks for your feedback.

  4. Jafin
    15 décembre 2010 | 6:46

    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

  5. Bob
    31 mai 2011 | 10:40

    Plz add support to spanish languege.

    Thx so much!

  6. Henri Demers
    16 janvier 2012 | 20:22

    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;
    }
    }

  7. 17 février 2012 | 8:14

    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).

  8. Yeprem
    30 août 2012 | 18:32

    Any chance you could republish this for VS 2012? I absolutely hate having to see this tab open.

  9. 31 août 2012 | 4:59

    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.

  10. 14 septembre 2012 | 19:04

    Hi Yeprem, I added support for Visual Studio 2012 a few days ago. Enjoy!

  11. Yeprem
    14 septembre 2012 | 19:27

    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.

  12. musa
    13 octobre 2012 | 8:24

    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

  13. 13 octobre 2012 | 9:48

    Hi Musa, I have never encountered the behavior you describe. I would need more information to help you.

  14. musa
    14 octobre 2012 | 16:34

    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.

  15. CK
    17 décembre 2012 | 6:55

    WAW amazing it is!!

    Thanks. Keep up the good work. ;)

    Thanks.

  16. Mark
    7 novembre 2013 | 19:55

    Friggin awesome. worked!

  17. ryan
    24 novembre 2014 | 21:59

    Thanks, this is fantastic

Laisser un commentaire