---
title: "Is there an equivalent of exit() for quitting a C# .NET application?"  
description: "Is there an equivalent of exit() for quitting a C# .NET application?"  
author: "Amit Singh"  
published: 2011-03-25  
updated: 2020-09-23  
canonical: https://www.mindstick.com/interview/606/is-there-an-equivalent-of-exit-for-quitting-a-c-sharp-dot-net-application  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# Is there an equivalent of exit() for quitting a C# .NET application?

Yes, you can use System.Environment.Exit(int exitCode) to exit the application or Application.Exit() if it’s a Windows Forms app.

## Answers

### Answer by Amit Singh

Yes, you can use System.Environment.Exit(int exitCode) to exit the application or Application.Exit() if it’s a Windows Forms app.


---

Original Source: https://www.mindstick.com/interview/606/is-there-an-equivalent-of-exit-for-quitting-a-c-sharp-dot-net-application

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
