I have a WPF C# application that contains a button.
The code of the button click is written in separate text file which will be placed in the applications runtime directory.
I want to execute that code placed in the text file on the click of the button.
Any idea how to do this?
You can use Microsoft.CSharp.CSharpCodeProvider
to compile code on-the-fly. In particular, see CompileAssemblyFromFile.