HKILP7M8 Posted July 29, 2004 Posted July 29, 2004 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. Quote
Administrators PlausiblyDamp Posted July 29, 2004 Administrators Posted July 29, 2004 Could you post the code for the application in question as it should work the same under VS 2005 Beta 1. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
HKILP7M8 Posted July 29, 2004 Author Posted July 29, 2004 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); } } } Quote
Arch4ngel Posted July 29, 2004 Posted July 29, 2004 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 !!! Quote "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
Wile Posted July 29, 2004 Posted July 29, 2004 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. Quote Nothing is as illusive as 'the last bug'.
HKILP7M8 Posted July 29, 2004 Author Posted July 29, 2004 In VS.net 2003 that did not happen, you just hit Start without debugging and there you go. Quote
Arch4ngel Posted July 29, 2004 Posted July 29, 2004 Well.. maybe... but It happened to me a lot in 2002 so... I figured It was the same... :p Quote "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
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.