Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C# C# Basics (Retired) Console I/O Start Coding

Mono Compiler Question: What Happens to EXE Files Created?

I'm still trying to understand compilers here and how they work, and C# is explained as a compiled language. When you run the compiler Jeremy (the instructor) mentions that a .exe file is created for you to then run the program with...however what I'm curious about is how permanent is that .exe file...meaning after you exit your program and exit the command prompt do your .exe compiled files remain until over-written by changes that you make to the program & re-compile the program? Or do the .exe files vanish after you exit (aka they're temporary files for use while you're running the program)?

Does the answer potentially change when working in C# with a different type of compiler? Or do all C# compilers behave the same in regards to .exe files?

1 Answer

Steven Parker
Steven Parker
229,771 Points

:point_right: Compiled output files are always permanent.

Generally, on any system, the compiled output file (".exe" on Windows) is as permanent as any other type of file. Of course, if you don't move or copy it, it will be overwritten if you compile again.