-2

I am a student and I am during my final project.

In my project I give an option to edit code and run it. The problem is, that I do not know how to create a new exe file after changing the code.

I would be happy if you can help me !!!

Thank you very much!

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • Possible duplicate of [Compiling/Executing a C# Source File in Command Prompt](https://stackoverflow.com/questions/553143/compiling-executing-a-c-sharp-source-file-in-command-prompt) – Klaus Gütter Feb 18 '19 at 20:28
  • This should allow you to compile the code using CMD : https://stackoverflow.com/questions/553143/compiling-executing-a-c-sharp-source-file-in-command-prompt – YouneS Feb 18 '19 at 21:02

1 Answers1

1

You can compile code into assemblies and then execute them as such.

This example should cover what I mean:

https://csharp.hotexamples.com/examples/System.CodeDom.Compiler/CodeDomProvider/CompileAssemblyFromFile/php-codedomprovider-compileassemblyfromfile-method-examples.html

You can access the compiled assembly from CompiledResults and run it directly in the current AppDomain like a script of some sorts or you can store it to an .exe

JTinkers
  • 1,631
  • 9
  • 18