Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public void Refresh() { }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")]
[System.Runtime.Versioning.SupportedOSPlatformAttribute("maccatalyst")] // this needs to come after the ios attribute due to limitations in the platform analyzer
public static System.Diagnostics.Process Start(string fileName, string arguments) { throw null; }
public static System.Diagnostics.Process Start(string fileName, string? arguments) { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")]
[System.Runtime.Versioning.SupportedOSPlatformAttribute("maccatalyst")] // this needs to come after the ios attribute due to limitations in the platform analyzer
Expand Down Expand Up @@ -221,7 +221,7 @@ public sealed partial class ProcessStartInfo
{
public ProcessStartInfo() { }
public ProcessStartInfo(string fileName) { }
public ProcessStartInfo(string fileName, string arguments) { }
public ProcessStartInfo(string fileName, string? arguments) { }
public ProcessStartInfo(string fileName, System.Collections.Generic.IEnumerable<string> arguments) { }
public System.Collections.ObjectModel.Collection<string> ArgumentList { get { throw null; } }
[System.Diagnostics.CodeAnalysis.AllowNullAttribute]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1313,7 +1313,7 @@ public static Process Start(string fileName)
[UnsupportedOSPlatform("ios")]
[UnsupportedOSPlatform("tvos")]
[SupportedOSPlatform("maccatalyst")]
public static Process Start(string fileName, string arguments)
public static Process Start(string fileName, string? arguments)
{
// the underlying Start method can only return null on Windows platforms,
// when the ProcessStartInfo.UseShellExecute property is set to true.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public ProcessStartInfo(string fileName)
/// Specifies the name of the application that is to be started, as well as a set
/// of command line arguments to pass to the application.
/// </devdoc>
public ProcessStartInfo(string fileName, string arguments)
public ProcessStartInfo(string fileName, string? arguments)
{
_fileName = fileName;
_arguments = arguments;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,17 @@ public void TestArgumentsProperty()
Assert.Equal("-arg3 -arg4", psi.Arguments);
}

[Fact]
public void TestArgumentsNullProperty()
{
string? args = null;
ProcessStartInfo psi = new ProcessStartInfo("filename", args);
Assert.Equal(string.Empty, psi.Arguments);

psi.Arguments = null;
Assert.Equal(string.Empty, psi.Arguments);
}

[ConditionalTheory(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported)), InlineData(true), InlineData(false)]
public void TestCreateNoWindowProperty(bool value)
{
Expand Down
Loading