Console app start and stop immediately

I developed a c# console app which run as expected (write multi  lines to console ) in my debug environment,
But when I pass it to production environment it start and stop after less than  1 sec  without any error massage and without writing any line ,also no relevant  massage  in the event  viewer , because it run shortly  I can’t remote attache the debugger to it .
How can I solve this problem? How to investigate\debug if I can’t attached to it? Where do I start?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

id start with
Console.WriteLine("Press any key to exit.");

Open in new window

that will stop the program from running and closing so quickly

also before running it it would do a Step-Thru (F10) in visual Studio

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Julian HansenCommented:
Are you sure the production machine has all the dependencies required for the application?
There might be an unhandled error and the program just crashes
Julian HansenCommented:
Check that Windows Error Reporting is enabled and look for reports of missing assemblies.
käµfm³d 👽Commented:
You might look into handling the following events:

If you attach handlers at the beginning of your application, then you should be able to log any events that you may not have explicitly caught--at least for debugging purposes.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.