-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Closed
Labels
area-System.ConsoleuntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner
Description
Description
For console applications that need to display a Windows Form executing the project with dotnet run displayed Console.Write* output in the same manner as a standard console application.
With .NET SDK (5.0.100-preview.8.20417.9) console output is no longer displayed.
If the program is built with Visual Studio and then run from directly from the .exe, with the Visual Studio debugger or with dotnet run --no-build then console output works properly.
If the program is build and run with dotnet run console output does not appear.
Configuration
.NET SDK (5.0.100-preview.8.20417.9)
Microsoft Windows 10 Pro 10.0.19041 Build 19041
x64
Other information
Minimal project and program file to replicate:
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>
</Project>
using System;
class Program
{
[STAThread]
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
- Build and execute with
dotnet runwill not display anything on the console. - Rebuild with Visual Studio and execute with
dotnet run --no-buildwill display console output. - Build and execute again with
dotnet runwill not display anything on the console.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-System.ConsoleuntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner