Skip to content

Instantly share code, notes, and snippets.

@rquackenbush
Created December 7, 2017 20:11
Show Gist options
  • Save rquackenbush/27af37df59dccaa91501da9b5dbd0468 to your computer and use it in GitHub Desktop.
Save rquackenbush/27af37df59dccaa91501da9b5dbd0468 to your computer and use it in GitHub Desktop.
private void LogMonoVersion()
{
try
{
Process process = new Process
{
StartInfo =
{
FileName = "mono",
Arguments = "--version",
UseShellExecute = false,
RedirectStandardOutput = true,
RedirectStandardError = true
}
};
process.Start();
//* Read the output (or the error)
string output = process.StandardOutput.ReadToEnd();
process.WaitForExit();
_logger.Information(output);
}
catch (Exception ex)
{
_logger.Error(ex, "Couldn't get the mono version.");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment