Book a Demo

Author Topic: Output when using VS Express 2008  (Read 3965 times)

floerio

  • EA User
  • **
  • Posts: 44
  • Karma: +0/-0
    • View Profile
Output when using VS Express 2008
« on: November 05, 2009, 06:29:40 pm »
Hi!

I am using Visual Studio Express 2008. For debugging purpose, I want to print some things on the output console of VS.

I am using something like this:

Code: [Select]
case "Connector":
    EA.Collection Connectors = e.Connectors;
        foreach (EA.Connector s in Connectors) {
              System.Console.Out.WriteLine("contextcnt " + e.Name);
                        x.Add(s); }
                    break;

But on the output window within VS, nothing appears. Nevertheless, internal C# messages are printed. e.g. when the system is started.

Info: I am writing a plug in, so the whole thing is executed as DLL. Is this a problem?

Cheers,
   Oliver

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Output when using VS Express 2008
« Reply #1 on: November 05, 2009, 07:43:06 pm »
Have already tried to set a breakpoint to see if the code execution even gets there?

Geert

Makulik

  • EA User
  • **
  • Posts: 400
  • Karma: +0/-0
    • View Profile
Re: Output when using VS Express 2008
« Reply #2 on: November 05, 2009, 10:48:58 pm »
Hi,

Quote
Info: I am writing a plug in, so the whole thing is executed as DLL. Is this a problem?
Yup, definitely! Usually there won't be any console to write your output to, when running as EA AddIn (I just guess that's what you're trying to do). I would recommend to either use Debug.Out to see your messages in the VS debug window when running your DLL in debugging mode, or to use a logfile.

HTH
Günther



Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: Output when using VS Express 2008
« Reply #3 on: November 06, 2009, 02:41:58 pm »
Or you could try writing to EA's output window from your Add-In using Repository.WriteOutput().  For Example:

Code: [Select]
Repository.WriteOutput("System", "Hello World", 0)More methods are available for interacting with EA's output window on the EA.Repository object, including CreateOutputTab(), EnsureOutputVisible(), and ClearOutput().