Created
December 7, 2017 20:11
-
-
Save rquackenbush/27af37df59dccaa91501da9b5dbd0468 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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