locked
Why my tool window doesn't appear when Visual Studio 2008 starts? RRS feed

  • Question

  • I have a "persistent" tool window(as it be designed to be) just didn't appear when Visual Studio 2008 starts.

    The code is very like the sample tool windows provided in the Visual Studio SDK. A VS package provides the registration of the tool window as follows:

        [PackageRegistration(UseManagedResourcesOnly = true)]
        [DefaultRegistryRoot("Software\\Microsoft\\VisualStudio\\9.0")]
        //[ProvideAutoLoad(Microsoft.VisualStudio.Shell.Interop.UIContextGuids.NoSolution)]
        [ProvideLoadKey("Standard", "1.0", "VSPackage", "FOO", 0x68)]
        [ProvideMenuResource(0x3e8, 1)]
        [ProvideToolWindow(typeof(StatusPane), Style = Microsoft.VisualStudio.Shell.VsDockStyle.Tabbed, Window = "3ae79031-e1bc-11d0-8f78-00a0c9110057")]
        [Guid(Guids.VSPkgString)]
    

    There is a MyToolWindowPane class inhertis ToolWindowPane and a StatusWinCtrl inherits UserControl.

        [Guid("...")]
        public class StatusPane : ToolWindowPane
    
        {
            /// Constructor with no argument is needed because of the spec of Visual Studio.
            public StatusPane() :
                base()
            {
                System.Diagnostics.Trace.WriteLine("Status Pane: Contructor");
                this.Caption = "Status";
            }
    
            protected override UserControl getUserCtrl()
            {
                System.Diagnostics.Trace.WriteLine("Status Pane: getUserCtrl");
                ...// return UserControl
            }
    
            protected override void OnCreate()
            {
                System.Diagnostics.Trace.WriteLine("Status Pane: OnCreate");
                base.OnCreate();
             }
    

    After installed pkg and started the Visual Studio 2008 with a solution, I enabled the tool window (StatusPane) and then closed the Visual Studio. When I restarted the Visual Studio 2008 with the same solution, the tool window just not there.  I noticed there something was displayed instantly but failed to find out what it is.

    I also tried to trace my code and got the trac log:

    1. StatusPane()
    2. StatusPane::getUserControl()

    As this tool window works completely correct in Visual Studio 2010 and the trace log is:]

    1. StatusPane()
    2. StatusPane::getUserControl()
    3. StatusPane()
    4. StatusPane::OnCreate()

    I just can't figure why my tool window doesn't work in Visual Studio 2008?

    Please provide some support.

    Thanks!

    Thursday, May 22, 2014 10:46 AM

Answers

  • Hi,

    Thanks for your support!

    My tool windows was provided by a VS package. This problem is sovled after adding registry, there was no code issue.

    Best regards

    • Marked as answer by Anna Cc Wednesday, May 28, 2014 7:08 AM
    Wednesday, May 28, 2014 6:56 AM

All replies

  • Hi,

    Welcome here!

    According to your description, you have customized your tool window using visual studio 2008. I guess you created a add-in.

    Have you activated the add-in?

    Please check this document " How to: Create and Control Tool Windows ". On the Tools menu, click Add-In Manager to activate the add-in.


    Best regards,
    • Edited by Anna Cc Friday, May 23, 2014 9:54 AM
    Friday, May 23, 2014 9:53 AM
  • Hi,

    Thanks for your support!

    My tool windows was provided by a VS package. This problem is sovled after adding registry, there was no code issue.

    Best regards

    • Marked as answer by Anna Cc Wednesday, May 28, 2014 7:08 AM
    Wednesday, May 28, 2014 6:56 AM
  • Hi,

    Glad to hear that you got it working.

    Thank you for sharing the solution here!

    Best regards,

    Wednesday, May 28, 2014 7:09 AM