diff --git a/src/Main/Base/Project/Src/Services/Debugger/DefaultDebugger.cs b/src/Main/Base/Project/Src/Services/Debugger/DefaultDebugger.cs index 66f2e451a0..a6519026c1 100644 --- a/src/Main/Base/Project/Src/Services/Debugger/DefaultDebugger.cs +++ b/src/Main/Base/Project/Src/Services/Debugger/DefaultDebugger.cs @@ -49,7 +49,7 @@ namespace ICSharpCode.SharpDevelop.Debugging OnDebugStarted(EventArgs.Empty); } catch (Exception) { OnDebugStopped(EventArgs.Empty); - throw new ApplicationException("Can't execute " + "\"" + processStartInfo.FileName + "\"\n"); + throw new ApplicationException("Can't execute \"" + processStartInfo.FileName + "\"\n"); } } diff --git a/src/Main/Base/Project/Src/Services/Profiler/DefaultProfiler.cs b/src/Main/Base/Project/Src/Services/Profiler/DefaultProfiler.cs index 096dfd04e3..405887c19a 100644 --- a/src/Main/Base/Project/Src/Services/Profiler/DefaultProfiler.cs +++ b/src/Main/Base/Project/Src/Services/Profiler/DefaultProfiler.cs @@ -5,7 +5,10 @@ // $Revision$ // +using ICSharpCode.Core; using System; +using System.Diagnostics; +using ICSharpCode.SharpDevelop.Gui; namespace ICSharpCode.SharpDevelop.Profiling { @@ -13,16 +16,19 @@ namespace ICSharpCode.SharpDevelop.Profiling { public bool CanProfile(ICSharpCode.SharpDevelop.Project.IProject project) { - return false; + return true; } - public void Start(System.Diagnostics.ProcessStartInfo info, string outputPath, Action afterFinishedAction) + public void Start(ProcessStartInfo info, string outputPath, Action afterFinishedAction) { - throw new NotSupportedException(); + MessageService.ShowError("Profiling not supported! " + + "No appropriate Profiler AddIn was found."); + afterFinishedAction(); } public void Dispose() { + Stop(); } public bool IsRunning { @@ -33,7 +39,6 @@ namespace ICSharpCode.SharpDevelop.Profiling public void Stop() { - throw new NotSupportedException(); } } } diff --git a/src/Main/Base/Project/Src/Services/Profiler/ProfilerService.cs b/src/Main/Base/Project/Src/Services/Profiler/ProfilerService.cs index 4b5336dd61..ecae1eef23 100644 --- a/src/Main/Base/Project/Src/Services/Profiler/ProfilerService.cs +++ b/src/Main/Base/Project/Src/Services/Profiler/ProfilerService.cs @@ -55,7 +55,7 @@ namespace ICSharpCode.SharpDevelop.Profiling } public static string GetSessionFileName(IProject project) - { + { string filename = @"ProfilingSessions\Session" + DateTime.Now.ToString("yyyyMMdd_HHmmss", CultureInfo.InvariantCulture) + ".sdps"; @@ -68,8 +68,10 @@ namespace ICSharpCode.SharpDevelop.Profiling } public static void AddSessionToProject(IProject project, string path) - { + { Action updater = () => { + if (!File.Exists(path)) + return; FileService.OpenFile(path); if (!project.ReadOnly) { FileProjectItem file = new FileProjectItem(project, ItemType.Content, "ProfilingSessions\\" + Path.GetFileName(path));