public ClrRuntime Attach(string processName, int attachWaitTimeMilliseconds)
{
Process[] processes = Process.GetProcessesByName(processName);
if(processes.Length == 0)
{
throw new ArgumentException(string.Format("No process with the name \"{0}\" appears to be running.", processName));
}
else if(processes.Length > 1)
{
throw new InvalidOperationException(string.Format("Multiple processes ({0}) with the name \"{1}\" are currently running. Please use AttachToProcess overload specifying process Id instead.", processes.Length, processName));
}
return this.Attach(processes[0], ClrMdPack.DefaultAttachWaitTimeMilliseconds);
}