At the moment, you cannot use C # as a scripting language unless you switch to Mono.
Microsoft said that this (or similar functionality) is on the roadmap for C # version 5, which is far in the future.
Currently, you can fake it by creating a temporary โcode fileโ as a line in memory, running the C # compiler from the outside to create a new assembly in memory, and then load and execute this assembly. This will work well once, but if you want to update it without rebooting, you will have to load the assembly in memory in a new application, and unload the old one each time (which becomes quite complicated).
Honestly, I would not bother. C # does not make a very good scripting language because of its compiled nature and static typing
source share