Programs run and exit  
Author Message
jtleach





PostPosted: Visual C# Express Edition, Programs run and exit Top

I'm very new to this. I'm having trouble actually running my programs through F5. They run, flash open for a split second and close. When I look at the output, it says "The Program has exited with code -1073741819."

I've seen a similar discussion surrounding console apps and that one seems easy to resolve, or has multiple options. How about for Windows apps

I am running the exact same version of Visual C# 2005 Express Edition on my desktop PC and have no problems. I just installed the software on my laptop and have the problems there. I've checked everything between the two and they seem to be configured the same.

Thoughts



Visual Studio Express Editions23  
 
 
ahmedilyas





PostPosted: Visual C# Express Edition, Programs run and exit Top

it shouldnt happen. Console apps generally do exit like what you are describing as its finished the code execution but in order for it to "stay" a workaround or a more wide solution used is to read key input from the keyboard so it "waits" or pauses before continuing. But if its for a Windows application then something is wrong somewhere.

are you able to step through the de**** to see at what point this occurs



 
 
SvenC





PostPosted: Visual C# Express Edition, Programs run and exit Top

When you look at that exit code in hex you get 0xC0000005. That is access violation. Can you set a breakpoint in the Main function and step further to get to the point that error occurs. Or does the error occur before this point

--
SvenC


 
 
Michael Blome - MSFT





PostPosted: Visual C# Express Edition, Programs run and exit Top

Since you are encountering an error, then the previous posted is correct: set a breakpoint using F9 on some line before where you suspect the error is occurring, and then step one line at a time using F10.

To run a console app from within C# Express so that the window stays open and you can read the program's output, your can also use Ctrl-F5 ("Run without Debugging") instead of F5.

Michael Blome

Visual C# Documentation Team