Execute ScriptCS from c# application <p><strong>Background</strong></p> <p>I'm creating a c# application that runs some status checks (think nagios style checks).</p> <p>What I ideally want is this c# application to look at a specific directory, and just compile/execute any scriptcs scripts within it, and act on the results (send email alerts for failing status checks for example).</p> <p>I would expect the script to return an integer or something (for example) and that integer would indicate weather the status check succeeded or failed.</p> <p>Values returned back to C# application.</p> <pre><code>0 - Success 1 - Warning 2 - Error </code></pre> <p>When first tasked with this I thought this is a job for MEF, but it would be vastly more convenient to create these 'status checks' without having to create a project or compile anything, just plopping a scriptcs script within a folder seems way more attractive.</p> <p><strong>So my questions are</strong></p> <ol> <li><p>Is there any documentation/samples on using a c# app and scriptcs together (google didn't net me much)?</p></li> <li><p>Is this a use case for scriptcs or was it never really intended to be used like this? </p></li> <li><p>Would I have an easier time just creating a custom solution using roslyn or some dynamic compilation/execution? (I have very little experience with scriptsc)</p></li> </ol>