Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions xml/System.Diagnostics/Process.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1629,7 +1629,7 @@ The following code example creates a process that prints a file. It sets the <xr
<exception cref="T:System.ArgumentException">The <paramref name="machineName" /> parameter syntax is invalid. It might have length zero (0).</exception>
<exception cref="T:System.ArgumentNullException">The <paramref name="machineName" /> parameter is <see langword="null" />.</exception>
<exception cref="T:System.PlatformNotSupportedException">The operating system platform does not support this operation on remote computers.</exception>
<exception cref="T:System.InvalidOperationException">There are problems accessing the performance counter API's used to get process information. This exception is specific to Windows NT, Windows 2000, and Windows XP.</exception>
<exception cref="T:System.InvalidOperationException">There are problems accessing the performance counter APIs used to get process information. This exception is specific to Windows NT, Windows 2000, and Windows XP.</exception>
<exception cref="T:System.ComponentModel.Win32Exception">A problem occurred accessing an underlying system API.</exception>
<altmember cref="P:System.Diagnostics.Process.MachineName" />
<altmember cref="M:System.Diagnostics.Process.GetProcessById(System.Int32,System.String)" />
Expand Down Expand Up @@ -1711,7 +1711,7 @@ The following code example creates a process that prints a file. It sets the <xr

]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">There are problems accessing the performance counter API's used to get process information. This exception is specific to Windows NT, Windows 2000, and Windows XP.</exception>
<exception cref="T:System.InvalidOperationException">There are problems accessing the performance counter APIs used to get process information. This exception is specific to Windows NT, Windows 2000, and Windows XP.</exception>
<altmember cref="P:System.Diagnostics.Process.ProcessName" />
<altmember cref="M:System.Diagnostics.Process.GetProcessById(System.Int32,System.String)" />
<altmember cref="M:System.Diagnostics.Process.GetProcesses" />
Expand Down Expand Up @@ -1795,7 +1795,7 @@ The following code example creates a process that prints a file. It sets the <xr

-or-

There are problems accessing the performance counter API's used to get process information. This exception is specific to Windows NT, Windows 2000, and Windows XP.</exception>
There are problems accessing the performance counter APIs used to get process information. This exception is specific to Windows NT, Windows 2000, and Windows XP.</exception>
<exception cref="T:System.ComponentModel.Win32Exception">A problem occurred accessing an underlying system API.</exception>
<altmember cref="P:System.Diagnostics.Process.ProcessName" />
<altmember cref="P:System.Diagnostics.Process.MachineName" />
Expand Down Expand Up @@ -2228,9 +2228,9 @@ You cannot cause processes on remote computers to exit. You can only view inform
<exception cref="T:System.NotSupportedException">You are attempting to call <see cref="M:System.Diagnostics.Process.Kill" /> for a process that is running on a remote computer. The method is available only for processes running on the local computer.</exception>
<exception cref="T:System.InvalidOperationException">The process has already exited.

-or-
There is no process associated with this <see cref="T:System.Diagnostics.Process" /> object.
-or-

There is no process associated with this <see cref="T:System.Diagnostics.Process" /> object.

-or-

Expand Down Expand Up @@ -5367,9 +5367,7 @@ The file specified in the <paramref name="fileName" /> could not be found.

You should only access the <xref:System.Diagnostics.Process.StartInfo%2A> property on a <xref:System.Diagnostics.Process> object returned by the <xref:System.Diagnostics.Process.Start%2A> method. For example, you should not access the <xref:System.Diagnostics.Process.StartInfo%2A> property on a <xref:System.Diagnostics.Process> object returned by <xref:System.Diagnostics.Process.GetProcesses%2A>. Otherwise, on .NET Core the <xref:System.Diagnostics.Process.StartInfo%2A> property will throw an <xref:System.InvalidOperationException> and on .NET Framework it will return a dummy <xref:System.Diagnostics.ProcessStartInfo> object.

When the process is started, the file name is the file that populates the (read-only) <xref:System.Diagnostics.Process.MainModule%2A> property. If you want to retrieve the executable file that is associated with the process after the process has started, use the <xref:System.Diagnostics.Process.MainModule%2A> property. If you want to set the executable file of a <xref:System.Diagnostics.Process> instance for which an associated process has not been started, use the <xref:System.Diagnostics.Process.StartInfo%2A> property's <xref:System.Diagnostics.ProcessStartInfo.FileName%2A> member. Because the members of the <xref:System.Diagnostics.Process.StartInfo%2A> property are arguments that are passed to the <xref:System.Diagnostics.Process.Start%2A> method of a process, changing the <xref:System.Diagnostics.ProcessStartInfo.FileName%2A> property after the associated process has started will not reset the <xref:System.Diagnostics.Process.MainModule%2A> property. These properties are used only to initialize the associated process.


When the process is started, the file name is the file that populates the (read-only) <xref:System.Diagnostics.Process.MainModule%2A> property. If you want to retrieve the executable file that is associated with the process after the process has started, use the <xref:System.Diagnostics.Process.MainModule%2A> property. If you want to set the executable file of a <xref:System.Diagnostics.Process> instance for which an associated process has not been started, use the <xref:System.Diagnostics.Process.StartInfo%2A> property's <xref:System.Diagnostics.ProcessStartInfo.FileName%2A> member. Because the members of the <xref:System.Diagnostics.Process.StartInfo%2A> property are arguments that are passed to the <xref:System.Diagnostics.Process.Start%2A> method of a process, changing the <xref:System.Diagnostics.ProcessStartInfo.FileName%2A> property after the associated process has started will not reset the <xref:System.Diagnostics.Process.MainModule%2A> property. These properties are used only to initialize the associated process.

## Examples
The following example populates a <xref:System.Diagnostics.Process.StartInfo%2A> with the file to execute, the action performed on it and whether it should displays a user interface. For additional examples, refer to the reference pages for properties of the <xref:System.Diagnostics.ProcessStartInfo> class.
Expand All @@ -5381,7 +5379,7 @@ The file specified in the <paramref name="fileName" /> could not be found.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">The value that specifies the <see cref="P:System.Diagnostics.Process.StartInfo" /> is <see langword="null" />.</exception>
<exception cref="T:System.InvalidOperationException">The <see cref="M:System.Diagnostics.Process.Start" /> method was not used to start the process.</exception>
<exception cref="T:System.InvalidOperationException">.NET Core only: The <see cref="M:System.Diagnostics.Process.Start" /> method was not used to start the process.</exception>
<altmember cref="M:System.Diagnostics.Process.Start" />
<altmember cref="P:System.Diagnostics.ProcessStartInfo.FileName" />
</Docs>
Expand Down