public override ProcessStartInfo CreateStartInfo() { switch (StartAction) { case StartAction.Project: return DotNetStartBehavior.CreateStartInfo(Project.GetInstallerFullPath(), Project.Directory, StartWorkingDirectory, StartArguments); default: return base.CreateStartInfo(); } }
public override void Start(bool withDebugging) { try { WebProjectProperties properties = WebProject.GetWebProjectProperties(); if (CheckWebProjectStartInfo()) { AttachToWebWorkerProcessOrStartIISExpress(properties, withDebugging); } // start default application(e.g. browser) or the one specified switch (CompilableProject.StartAction) { case StartAction.Project: if (FileUtility.IsUrl(properties.IISUrl)) { Process.Start(properties.IISUrl); } else { MessageService.ShowError("${res:ICSharpCode.WebProjectOptionsPanel.NoProjectUrlOrProgramAction}"); DisposeProcessMonitor(); } break; case StartAction.Program: ProcessStartInfo processInfo = DotNetStartBehavior.CreateStartInfo(StartProgram, Project.Directory, StartWorkingDirectory, StartArguments); if (withDebugging) { DebuggerService.CurrentDebugger.Start(processInfo); } else { Process.Start(processInfo); } break; case StartAction.StartURL: if (FileUtility.IsUrl(StartUrl)) { Process.Start(StartUrl); } else { string url = string.Concat(properties.IISUrl, StartUrl); if (FileUtility.IsUrl(url)) { Process.Start(url); } else { MessageService.ShowError("${res:ICSharpCode.WebProjectOptionsPanel.NoProjectUrlOrProgramAction}"); DisposeProcessMonitor(); return; } } break; default: throw new Exception("Invalid value for StartAction"); } } catch (Exception ex) { MessageService.ShowError(ex.Message); LoggingService.Error(ex.ToString()); DisposeProcessMonitor(); } }