Visual Studio Developer Center > Visual Studio Forums > Phoenix > Some Problem about Phoenix redirect Plug-in's output??
Ask a questionAsk a question
 

QuestionSome Problem about Phoenix redirect Plug-in's output??

  • Thursday, October 29, 2009 11:03 AMJohn Connor Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Hello everyone :

    could it does just like the title?
    i want to redirect output to a file just like "FlowGraph.txt";
    so i add the follow code to the Execute method:

    System.IO.TextWriter t = new System.IO.StreamWriter("FlowGraph.txt");





    System.Console.SetOut(t);



    i built the plug-in, it done.
    but when i use the commod line just like "cl -d2plugin:FlowGraph.dll test.cpp"


    it output the follow line to the console(not the file):

    fatal error C1001:An internal error has occurred in the compiler.
    (compiler file 'd:\enlistments\sdk_june08\src\clients\c2\c2-diagnostice.cpp',line 742)
    Unhandled Exception

    why ?? i think i did all the right thing!!

All Replies

  • Friday, October 30, 2009 7:50 AMAndy Ayers - MSFTModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    You should be able to run this under the debugger and get more information about what is going wrong.

    First, compile your plugin with /debug+.

    Then, in the command shell, run

    devenv -debugexe cl -d2plugin:FlowGraph.dll test.cpp

    Visual studio will launch and create a special debugging project for cl.exe. Right click on this project and select properties, then debugging. Set the debugger type to "Managed Only" and click OK to close the property sheet. Then go to the Debug menu and choose Exceptions. Put checkmarks in the "thrown" or "first-chance" column for the various exception types. Hit F5 to launch cl.exe under the debugger. When the exception happens the debugger will gain control and you can see where you are in the code and what kind of problem is being hit.
    Architect - Microsoft Phoenix Project