Question

Is there a way to create and build an .exe from C#? (Editor's Note: Basically a .NET app that can create and compile other .NET apps - see accepted answer)

I am NOT talking about getting the .exe of my project (which is the only exe building I could find on google), I am talking about generating .exe files from within my program.

How would I create a runnable .exe file from C#? I have no idea how and on google I only find questions on where to find the .exe of the Project, while I want the project to build .exe's itself.

Was it helpful?

Solution

The simplest way to do it without using external compilers is called CodeDOM, the relevant class you would use is called CSharpCodeProvider. There there are many tutorials on the internet (including one in the first link I gave) that will show you how to use it, the topic is too broad to explain in depth here.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top