diff --git a/ILSpy/MainWindow.xaml.cs b/ILSpy/MainWindow.xaml.cs index 7a79cc166..898b5a7bc 100644 --- a/ILSpy/MainWindow.xaml.cs +++ b/ILSpy/MainWindow.xaml.cs @@ -307,9 +307,17 @@ namespace ICSharpCode.ILSpy foreach (char c in Path.GetInvalidFileNameChars()) name = name.Replace(c, '-'); string fileName = Path.Combine(Path.GetTempPath(), name); - graph.Save(fileName + ".gv"); - Process.Start("dot", "\"" + fileName + ".gv\" -Tpng -o \"" + fileName + ".png\"").WaitForExit(); - Process.Start(fileName + ".png"); + graph.Save(fileName + ".gv"); + try + { + Process.Start("dot", "\"" + fileName + ".gv\" -Tpng -o \"" + fileName + ".png\"").WaitForExit(); + Process.Start(fileName + ".png"); + } + catch (Win32Exception ex) + { + MessageBox.Show(String.Format("Unable to find Graphviz on your computer. Please install it. {0}", ex.Message), "ILSpy"); + } + } #endif #endregion