PC Review


Reply
Thread Tools Rate Thread

Console.Writeline output in VSTO

 
 
Ed White
Guest
Posts: n/a
 
      30th Jul 2008
When writing VB.Net code in VSTO, I've used Debug.Print and
Console.Writeline, but the output does not appear in the Output window.
Where do I find the output?
--
Ed
 
Reply With Quote
 
 
 
 
Jialiang Ge [MSFT]
Guest
Posts: n/a
 
      30th Jul 2008
Hello Ed,

Console.WriteLine does not have output because it requires a console for
the standard I/O.

Debug.Print: Please make sure that "Debug" is selected in the "Show output
from" list of the Output window. A simple test of Debug.Print in VSTO works
on my side. Ed, if this suggestion does not help you, would you please tell
me your VS version and some code snippet. I will try to reproduce the
symptom after I get these information. Thanks.

Regards,
Jialiang Ge ((E-Mail Removed), remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(E-Mail Removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

 
Reply With Quote
 
Ed White
Guest
Posts: n/a
 
      30th Jul 2008
I'm running VS 2008 with Excel 2007.

Perhaps I need to clarify my question. When I'm running VSTO directly
inside of Visual Studio (as opposed to opening up the Excel solution outside
of VS), and I use Console.Writeline in my code, VS does in fact have a
Console output window, and Console.Writeline from a normal VB program running
inside of VS does write the output to the Console window. However, when I
try this from VB code in VSTO
Console.Writeline("This is a test")
I don't get any output anywhere.

To test the above, create an Excel Worksheet VSTO solution, add a button
(Button1) to the Excel spreadsheet, and Add Code the the buttion for the
Button1 Click event handler that simply says
Console.Writeline("Button1 was clicked") : Stop
Then run the solution from VS (e.g. hit F5), and click Button1. The program
should stop at the Stop statement (confirming the previous code was
executed). However, the "Button1 was clicked" does not show up anywhere that
I looked, including VS's Console, Immediate, and Command windows.
(Obviously, if I run open the Excel file outside of VS, I wouldn't expect any
output--I would like it inside of VS for debugging purposes.)

As for you comment on Debug.Print, I don't understand where to make the menu
selection you suggested. Under VS's View menu, there is no option for
"Debug". Under VBA, Debug.Print will in fact print to the VBA Immediate
window (that works fine on my system), but I'm not writing VBA, I'm writing
VB in VSTO.


--
Ed


""Jialiang Ge [MSFT]"" wrote:

> Hello Ed,
>
> Console.WriteLine does not have output because it requires a console for
> the standard I/O.
>
> Debug.Print: Please make sure that "Debug" is selected in the "Show output
> from" list of the Output window. A simple test of Debug.Print in VSTO works
> on my side. Ed, if this suggestion does not help you, would you please tell
> me your VS version and some code snippet. I will try to reproduce the
> symptom after I get these information. Thanks.
>
> Regards,
> Jialiang Ge ((E-Mail Removed), remove 'online.')
> Microsoft Online Community Support
>
> Delighting our customers is our #1 priority. We welcome your comments and
> suggestions about how we can improve the support we provide to you. Please
> feel free to let my manager know what you think of the level of service
> provided. You can send feedback directly to my manager at:
> (E-Mail Removed).
>
> ==================================================
> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscripti...ult.aspx#notif
> ications.
>
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> http://msdn.microsoft.com/subscripti...t/default.aspx.
> ==================================================
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>

 
Reply With Quote
 
Jialiang Ge [MSFT]
Guest
Posts: n/a
 
      31st Jul 2008
Hello Ed,

1. Debug.Print

I meant the window at VS->View->Output or VS->Debug->Windows->Output by
"Output Window".

You said that by no mean could you find the output of Debug.Print, would
you please check whether the current build mode is set to "Debug" (To
better illustrate it, I have sent an email to you with the screenshot)? Is
the "DEBUG" constant defined in the build option? Debug.Print outputs the
content to the Output Window as long as we are in Debug mode and the
"DEBUG" constant is defined.

2. Console.WriteLine

Console.Write outputs the content to the standard IO. You can see the
output in the "Console Window" of a normal Winform project, because the
Winform package helps us to redirect the content to the window. But for
VSTO, the VSTO package did not do it because the VSTO designers believe
Debug.Print is functional enough for the purpose.

If you have any other questions or concerns, please DON'T hesitate to tell
me.

Regards,
Jialiang Ge ((E-Mail Removed), remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(E-Mail Removed).

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================

 
Reply With Quote
 
Ed White
Guest
Posts: n/a
 
      31st Jul 2008
Thanks very much for this response. I tried it, and it works, except the
Debug.Print does not output to the Output window, it outputs to VS’s
Immediate window on my PC.
--
Ed


""Jialiang Ge [MSFT]"" wrote:

> Hello Ed,
>
> 1. Debug.Print
>
> I meant the window at VS->View->Output or VS->Debug->Windows->Output by
> "Output Window".
>
> You said that by no mean could you find the output of Debug.Print, would
> you please check whether the current build mode is set to "Debug" (To
> better illustrate it, I have sent an email to you with the screenshot)? Is
> the "DEBUG" constant defined in the build option? Debug.Print outputs the
> content to the Output Window as long as we are in Debug mode and the
> "DEBUG" constant is defined.
>
> 2. Console.WriteLine
>
> Console.Write outputs the content to the standard IO. You can see the
> output in the "Console Window" of a normal Winform project, because the
> Winform package helps us to redirect the content to the window. But for
> VSTO, the VSTO package did not do it because the VSTO designers believe
> Debug.Print is functional enough for the purpose.
>
> If you have any other questions or concerns, please DON'T hesitate to tell
> me.
>
> Regards,
> Jialiang Ge ((E-Mail Removed), remove 'online.')
> Microsoft Online Community Support
>
> =================================================
> Delighting our customers is our #1 priority. We welcome your comments and
> suggestions about how we can improve the support we provide to you. Please
> feel free to let my manager know what you think of the level of service
> provided. You can send feedback directly to my manager at:
> (E-Mail Removed).
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
> =================================================
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing the output from Console.Writeline Randy Microsoft VB .NET 4 27th Apr 2007 03:59 AM
How can I redirect Console.Writeline to Response.Output? =?Utf-8?B?QUFPTSBUaW0=?= Microsoft ASP .NET 2 21st Mar 2007 07:14 PM
Console.WriteLine vs. Debug.WriteLine formatting Zytan Microsoft C# .NET 1 27th Feb 2007 02:24 AM
loosing Console.WriteLine output after P/Invoke =?Utf-8?B?dGIyMDAw?= Microsoft Dot NET Compact Framework 3 3rd Feb 2006 11:21 AM
Console.WriteLine output =?Utf-8?B?Um9uIEJyb213ZWxs?= Microsoft Dot NET 1 25th Feb 2005 10:47 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:35 AM.