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 483567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T01:12:39+00:00 2026-05-13T01:12:39+00:00

I am writing a custom tool and I currently have it doing what I

  • 0

I am writing a custom tool and I currently have it doing what I want as far as functionality. I would like to be able to write to Visual Studio if something goes wrong. (Incorrectly formatted code or whatever).

Are there any standards for this? Right now I basically can force the tool to fail and Visual Studio puts in a warning that it has done so. I’d like a category in the Output window with any resulting messages I want to send. I could also live with a more descriptive task/warning in the Error list window.

  • 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-05-13T01:12:39+00:00Added an answer on May 13, 2026 at 1:12 am

    Output Window

    To write to the “General” output window in Visual Studio, you need to do the following:

    IVsOutputWindow outWindow = Package.GetGlobalService( typeof( SVsOutputWindow ) ) as IVsOutputWindow;
    
    Guid generalPaneGuid = VSConstants.GUID_OutWindowGeneralPane; // P.S. There's also the GUID_OutWindowDebugPane available.
    IVsOutputWindowPane generalPane;
    outWindow.GetPane( ref generalPaneGuid , out generalPane );
    
    generalPane.OutputString( "Hello World!" );
    generalPane.Activate(); // Brings this pane into view
    

    If, however, you want to write to a custom window, this is what you need to do:

    IVsOutputWindow outWindow = Package.GetGlobalService( typeof( SVsOutputWindow ) ) as IVsOutputWindow;
    
    // Use e.g. Tools -> Create GUID to make a stable, but unique GUID for your pane.
    // Also, in a real project, this should probably be a static constant, and not a local variable
    Guid customGuid = new Guid("0F44E2D1-F5FA-4d2d-AB30-22BE8ECD9789");
    string customTitle = "Custom Window Title";
    outWindow.CreatePane( ref customGuid, customTitle, 1, 1 );
    
    IVsOutputWindowPane customPane;
    outWindow.GetPane( ref customGuid, out customPane);
    
    customPane.OutputString( "Hello, Custom World!" );
    customPane.Activate(); // Brings this pane into view
    

    Details on IVsOutputWindow and IVsOutputWindowPane can be found on MSDN.

    Error List

    For adding items to the error list, the IVsSingleFileGenerator has a method call void Generate(...) which has a parameter of the type IVsGeneratorProgress. This interface has a method void GeneratorError() which lets you report errors and warnings to the Visual Studio error list.

    public class MyCodeGenerator : IVsSingleFileGenerator
    {
        ...
        public void Generate( string inputFilePath, string inputFileContents, string defaultNamespace, out IntPtr outputFileContents, out int output, IVsGeneratorProgress generateProgress )
        {
            ...
            generateProgress.GeneratorError( false, 0, "An error occured", 2, 4);
            ...
        }
        ...
    }
    

    The details of GeneratorError() can be found on MSDN.

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

Sidebar

Related Questions

I'm writing a custom makefile project using QtCreator and I want to delete a
I'm writing custom ActionFilterAttribute and trying to write some data directly into output stream
While writing a custom import tool for a Tridion 2011 project using the core
I need help writing custom functions for my casio fx-9860g I have done this
I'm writing a structural modeling tool for a civil enginering application. I have one
I'm currently writing an Eclipse text editor plugin for a custom language. The problem
I am writing a custom ConfigurationElementCollection for a custom ConfigurationHandler in C#.NET 3.5 and
I am writing a custom .pac script for use with Firefox. Following numerous examples
I'm writing a custom deserializer that will deserialize a list by deserializing each of
I am writing a custom wrapper for open_flash_chart plugin. It's placed in /lib and

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.