Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 7th, 2005, 03:06 PM
Registered User
 
Join Date: Nov 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with First.cs output via Console.WriteLine


When running the console application First.cs (p. 38, Wrox Professional C# 2nd Edition), I'm not seeing any console output.

I have the SDK installed, the path set properly, and csc.exe works correctly. However, when I open a command prompt (whether the standard Windows cmd prompt, or the Visual Studio .NET command prompt), I do not see the output I expect from the Console.WriteLine method.

There is nothing wrong with the program code itself. (I took it directly from the Wrox website, and I've also tried several other basic "hello world" type programs from other C# websites.) I've also tried redirecting stdout to a file, without any success.

The code is shown below:

using System;

namespace Wrox.ProCSharp.Basics
{
   class MyFirstCSharpClass
   {
      static void Main()
      {
         Console.WriteLine("This isn't at all like Java!");
         Console.ReadLine();
         return;
      }
   }
}

And the only output is the from the csc command itself, but not the text from the WriteLine:

D:\ScriptDev\C#\Ch2>csc First.cs
Microsoft (R) Visual C# .NET Compiler version 7.10.3052.4
for Microsoft (R) .NET Framework version 1.1.4322
Copyright (C) Microsoft Corporation 2001-2002. All rights reserved.

What's happening to my stdout output?

Thanks,
Patrick

 
Old November 7th, 2005, 03:17 PM
Registered User
 
Join Date: Nov 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Nevermind...

I was expecting the command

csc First.cs

to both complie and execute the program (being used to having the Windows scripting engine (cscript.exe) both interpret and immediately execute my VBScript stuff). I realize now I have to execute the First.exe executable separately.








Similar Threads
Thread Thread Starter Forum Replies Last Post
Redirect Console Output(VB.Net) danasegarane Visual Studio 2005 1 September 9th, 2007 10:30 AM
writeline to an application Vinny_68 Pro Visual Basic 2005 0 April 16th, 2007 09:40 AM
Console.WriteLine ritag ADO.NET 2 February 9th, 2005 11:09 AM
Console output rewriting holdmykidney Java GUI 3 November 26th, 2004 12:16 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.