Is there any way to load a .txt file as a class, which my main program can then call functions from? I\'m basically trying to add mod support to my simple app, where the us
You could load a text file and then use some Compiler-as-a-service (either Microsoft's pre-release Roslyn project or Mono.CSharp). Then you can take the compiled outputs and run them in your program.
If it's at all possible to get your user to hand you a compiled assembly instead of an uncompiled source file, you should consider the Managed Extensibility Framework or Mono.Addins.
The second approach (extension assemblies) seems better to me for at least two reasons: 1) your user can use whatever development environment they'd like to make sure their code compiles correctly before handing it over to you, and 2) you have less work to do to validate input and handle failures.