Visual Studio에서 "일반"출력 창에 쓸 수있는 출력 창, 다음을 수행해야 IVsOutputWindow 및 IVsOutputWindowPane에
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
자세한 사항은 MSDN에서 찾을 수 있습니다 : 이것은 당신이해야 할 일이다.
오류 목록에 항목을 추가
오류 목록은 IVsSingleFileGenerator
는 유형 IVsGeneratorProgress
의 매개 변수가있는 메서드 호출 void Generate(...)
있습니다. 이 인터페이스에는 오류 및 경고를 Visual Studio 오류 목록에보고 할 수있는 void GeneratorError()
메서드가 있습니다.
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);
...
}
...
}
자세한 내용은 GeneratorError()은 MSDN에서 찾을 수 있습니다.
표준 출력으로 쓰는 것이 왜 효과가 없습니까? – avakar
Console.Write에 메시지를 쓰지 않아도 출력 창에 아무것도 표시되지 않습니다. –