-
netcoreapp3.1
No Problem description: WindowsFormsApp1.csproj <Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>
</Project> Form1.cs using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApp2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
Console.WriteLine("TEST"); // Add only this line.
}
}
} Expected behavior:
Please tell me how to output string to Minimal repro:
|
Beta Was this translation helpful? Give feedback.
Answered by
RussKie
Feb 15, 2021
Replies: 1 comment 3 replies
-
A console window is not shown for UI app by default. To show the console set the <DisableWinExeOutputInference>true</DisableWinExeOutputInference> This doc describes a workaround, and whilst it targets .NET 5.0, it also fixes the issue for .NET Core 3.1 and earlier. |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
danmoseley
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A console window is not shown for UI app by default. To show the console set the
DisableWinExeOutputInference
property totrue
in your project file.This doc describes a workaround, and whilst it targets .NET 5.0, it also fixes the issue for .NET Core 3.1 and earlier.