dotnet / dotnet/dotnet-api-docs
System.Diagnostic.Process.Start(string) API documentation still assuming UseShellExecute being true by default.
- Dominant language
- C#
- Stars
- 949
- Forks
- 1.7k
- Avg merge
- 3d 27m
- Merged PRs (30d)
- 49
Description
**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](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process?view=net-7.0) 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
Contributor guide
Assessment
This issue has not been assessed yet.