Skip to content

StandardOutput/StandardError of launched process is not shown #4828

@mxschmitt

Description

@mxschmitt

Describe the bug

When launching a process StandardOutput and StandardError is not shown. When launching the same code via a new console app it works.

Steps To Reproduce

Provide the steps to reproduce the behavior:

  1. Create a new MSTest project via: dotnet new mstest -n PlaywrightTests; cd PlaywrightTests
  2. Modify the UnitTest1.cs file and put the following into it:
using System.Diagnostics;

namespace PlaywrightTests;

[TestClass]
public class UnitTest1
{
    [TestMethod]
    public void TestMethod1()
    {
        var process = new Process();
        process.StartInfo.FileName = "C:\\Program Files\\PowerShell\\7\\pwsh.exe";
        process.StartInfo.Arguments = "-c \"echo 'hello from stdout'; Write-Error 'hello from stderr'\"";
        process.Start();
        process.WaitForExit();
    }
}
  1. Run the test via dotnet test

Expected behavior

Output shown

Actual behavior

Nothing shown

Additional context

Affected project: https://github.com/microsoft/playwright-dotnet

When doing the same via dotnet new console it works and gets displayed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions