locked
Creating a log window for an Add-in in visual Studio RRS feed

  • Question

  • I want to run my visual studio add-in on asp.net websites. Some evaluation results should be displayed to the user through a window as the one we get with  errors and warnings while running/ building a normal VS project. Does any one know how to do this? Please help me at-least with some related search that I can get help from. can we create them as creating forms etc ? currently I have no idea.
    Monday, June 3, 2013 11:33 AM

Answers

All replies

  • Hi,

    1) To add a task to the Task List toolwindow see:

    HOWTO: Add a filtered task with navigation to the Task List from a Visual Studio add-in
    http://www.mztools.com/articles/2008/MZ2008014.aspx

    2) To add an error to the Error List toolwindow see:

    HOWTO: Add an error with navigation to the Error List from a Visual Studio add-in
    http://www.mztools.com/articles/2008/MZ2008022.aspx

    3) To create your own toolwindow with a custom control inside see:

    HOWTO: Create a dockable toolwindow from a Visual Studio .NET add-in.
    http://www.mztools.com/articles/2006/MZ2006007.aspx

    4) To learn more about add-ins creation see:

    MZ-Tools Articles Series (about add-ins)
    http://www.mztools.com/resources_vsnet_addins.aspx#MZToolsArticles



    MZ-Tools: Productivity add-ins for Visual Studio: http://www.mztools.com. My blog about developing add-ins: http://msmvps.com/blogs/carlosq/

    Monday, June 3, 2013 3:09 PM
  • Thank you so much for the quick reply Carlos. I think Now I can start working on it.
    Monday, June 3, 2013 3:34 PM
  • I use the following code to create an output window to write my extension's debug and logging information to. This will show up as a "tab' in the Output window of Visual Studio:

    IVsOutputWindow outputWindow = this.GetService(typeof(SVsOutputWindow)) as IVsOutputWindow;
    if (outputWindow == null)
    {
    	Debug.WriteLine("Can not get the SVsOutputWindow service.");
    	return;
    }
    
    Guid dtwindow = new Guid("{44188E85-D444-4f5e-836B-D81BAEC9E90A}");
    int ret = outputWindow.CreatePane(ref dtwindow, "DC", 1, 1);
    if (ret != VSConstants.S_OK)
    {
    	Debug.WriteLine("outputWindow.CreatePane() failed!");
    	return;
    }
    
    IVsOutputWindowPane windowPane;
    if (ErrorHandler.Failed(outputWindow.GetPane(ref dtwindow, out windowPane)) || (null == windowPane))
    {
    	Debug.WriteLine("Failed to get the Output window pane.");
    	return;
    }


    Tuesday, June 4, 2013 9:21 AM
  • Hi Dylan,

    thanks for the reply but I don't really know how to use IVsOutputWindowsPane in my project. Microsoft.VisualStudio.Shell.Interop Namespace is required, isn't that so? Can you tell me how to add this reference. apparently it is not in the .net reference list. a file names 'Microsoft.VisualStudio.Shell.Interop' exists in 'C:\Windows\assembly' location in my PC.

    Tuesday, June 4, 2013 5:27 PM
  • Are you using an add-in or a package?

    MZ-Tools: Productivity add-ins for Visual Studio: http://www.mztools.com. My blog about developing add-ins: http://msmvps.com/blogs/carlosq/

    Tuesday, June 4, 2013 6:25 PM
  • I am using an add-in and it needs to be run on asp.net websites
    Tuesday, June 4, 2013 6:51 PM
  • Then you don't need IVsOutputWindowPane.

    Refer to the articles that I provided, which are intended for add-ins.


    MZ-Tools: Productivity add-ins for Visual Studio: http://www.mztools.com. My blog about developing add-ins: http://msmvps.com/blogs/carlosq/

    Tuesday, June 4, 2013 7:46 PM
  • Hi Carlos,

    I wanted something to tryout that is explained in this link that you mentioned http://www.mztools.com/articles/2006/MZ2006007.aspx.

     I tried out the code (C#) in my project. Can you please let me know what is the expected output of it. because when i successfully build and run the add-in on my website, I cant see any output. 

    By the way, I am using visual studio 2010 where the  the _applicationObject is a DTE2 instance. will it make any difference?

    Wednesday, June 5, 2013 6:30 AM
  • Finally it worked. don't know why it didn't work at the first time. it should add a button call 'MyToolWIndow' to the standard tool bar and when we click on that, the tool window (the user control i created) appears as a dock-able window. the button didn't anyway appear first but after restarting the machine, it's there! 
    Thursday, June 6, 2013 5:17 PM