Skip to content

System.Diagnostic.Process.Start(string) API documentation still assuming UseShellExecute being true by default. #8727

Open
@elgonzo

Description

@elgonzo

Issue description

The API documentation page for the System.Diagnostic.Process.Start(string) method for .NET Core 2.1 up to .NET 7 incorrectly describes that it is possible to provide the path to a document file instead of an executable file. A list of quotes from the .NET 7-related API documentation (https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.start?view=net-7.0#system-diagnostics-process-start(system-string)):

Starts a process resource by specifying the name of a document or application file and associates the resource with a new Process component.

Parameters
fileName String
The name of a document or application file to run in the process.

Therefore, the file name does not need to represent an executable file. It can be of any file type for which the extension has been associated with an application installed on the system. For example the file name can have a .txt extension if you have associated text files with an editor, such as Notepad, or it can have a .doc if you have associated .doc files with a word processing tool, such as Microsoft Word.

All the explanations regarding document files are wrong with respect to .NET Core 2.1 and newer, due to a change of the default value of ProcessStartInfo.UseShellExecute (https://learn.microsoft.com/en-us/dotnet/core/compatibility/fx-core#change-in-default-value-of-useshellexecute).

Target framework

  • [*] .NET Core 2.1 and newer

Metadata

Metadata

Assignees

No one assigned

    Labels

    Pri3Indicates issues/PRs that are low priorityarea-System.Diagnostics.Processhelp wantedGood for community contributors to help [up-for-grabs]

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions