HackedBrain.ScriptCs.ClrMd.ClrMdPack.Attach C# (CSharp) Method

Attach() public method

public Attach ( string processName, int attachWaitTimeMilliseconds ) : Microsoft.Diagnostics.Runtime.ClrRuntime
processName string
attachWaitTimeMilliseconds int
return Microsoft.Diagnostics.Runtime.ClrRuntime
		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);
		}

Same methods

ClrMdPack::Attach ( Process process, int attachWaitTimeMilliseconds ) : Microsoft.Diagnostics.Runtime.ClrRuntime
ClrMdPack::Attach ( int processId ) : Microsoft.Diagnostics.Runtime.ClrRuntime
ClrMdPack::Attach ( int processId, int attachWaitTimeMilliseconds ) : Microsoft.Diagnostics.Runtime.ClrRuntime
ClrMdPack::Attach ( string processName ) : Microsoft.Diagnostics.Runtime.ClrRuntime