MrDatabase MrDatabase - 6 months ago 34
C# Question

How do I specify the exit code of a console application in .NET?

I have a trivial console application in .NET. It's just a test part of a larger application. I'd like to specify the "exit code" of my console application. How do I do this?


You can return it from Main if you declare your Main method to return int, or call Environment.Exit(code).