.NET console Application fails to execute from CMD.EXE

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have vb.NET console application that I execute in batch from CDM.exe. When
submitted via a 3rd party tool, or by hand myself, the application will
sometimes return immediately with no error message just a command prompt. I
can then arrow up to get the same command and press enter and it may run the
second time.

My main routine starts with a try, the first command in the try is a
console.writeline, my traps log nothing, my console.writeline message does
not appear, the application appears to be 'stillborn'.

This effect is found in my test and prod environment but never in dev.

Please help a desperate man.

safox
 
First off, do you have the [STAThread] attribute in your initial class? If
you created your app as a DLL and decided to make an EXE, or if you decided
to delete this attribute just to see what is going on, you may be running
into a problem synchronizing your thread with the I/O channels.

An interesting explanation is here
http://www.sellsbrothers.com/askthewonk/secure/default.aspx?content=whatdoesthestathreadattri.htm

If that doesn't help, I'm not sure where to look.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
 
Back
Top