Description
Description
Some properties of the System.Diagnostics.Process
(e.g., PrivateMemorySize64) don't work on MacOS or other OSs as described in the API document https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process.privatememorysize64?view=net-6.0#system-diagnostics-process-privatememorysize64.
I realized the problem when checking the test file on GitHub at src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs
, rather than relying solely on the documentation or the IDE,
I recommend updating the documentation
to reflect accurate behavior or making it platform-specific
until resolved. This ensures developers receive accurate information for effective use.
Thanks
Reproduction Steps
Just compare the docs here https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.process
and tests at System.Diagnostics.Process/tests/ProcessTests.cs
.
Expected behavior
- At least, the API doc is updated to reflect the accurate behavior.
- Add OSPlatformAttribute to APIs that don't function properly on some OSs.
- It would be fantastic if these APIs could behave consistently across different platforms.
Actual behavior
The API documentation does not specify that APIs may not return actual values on some OSs, and no warning from IDE or compiler when using these APIs, whereas, in reality, the APIs do not return actual values on some OSs.
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response