Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Anybody know how to run a console app in VS.net 2005 Beta 1?

In 2003 I simply chose to "Start without debugging", in 2005 the window appears and closes right away. Any ideas would be greatly appreciated.

Posted

I'm trying to run this very simple console app.

 

using System;

 

namespace Ch03EX01

{

/// <summary>

/// Summary description for Class1.

/// </summary>

class Class1

{

/// <summary>

/// The main entry point for the application.

/// </summary>

[sTAThread]

static void Main(string[] args)

{

int myInteger;

string myString;

myInteger = 1960;

myString = "\"myInteger\" is";

Console.WriteLine("{0} {1}.", myString, myInteger);

}

}

}

Posted

Well... as it only show 1 line... as soon as the line is shown.... the application close... lolllll

you'll have to open the command prompt and open it from there or put a Breakpoint to see the result :p

 

have fun !!!

"If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown

"Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me

"A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend.

C# TO VB TRANSLATOR

Posted

Arch4ngel is right, the application does what you want and as it is finished, it exits immediatly again.

 

In VS 6 (havent tried it VS.net yet) if you ran an console application as exe (so not under the debugger with F5, but start it throught the exclamation mark icon CTRL+F5) it would pause at the end of a console application and ask you to press enter to close it.

Havent tried this in VS.NET so I dont know if this trick still works in VS.net 2005

Other solution: ask for some userinput in the last line of the main. So it will wait on the userinput before closing the console.

Nothing is as illusive as 'the last bug'.
Posted
Well.. maybe... but It happened to me a lot in 2002 so... I figured It was the same... :p

"If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown

"Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me

"A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend.

C# TO VB TRANSLATOR

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...