Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WPF .NET Core - Console Application doesn't open console #4138

Closed
vsfeedback opened this issue Feb 4, 2021 · 3 comments
Closed

WPF .NET Core - Console Application doesn't open console #4138

vsfeedback opened this issue Feb 4, 2021 · 3 comments

Comments

@vsfeedback
Copy link

This issue has been moved from a ticket on Developer Community.


When I create a WPF .NET Framework app and change project output type from Window Application to Console Application, the console opens as expected when I run the program.

When I create a WPF .NET Core app it and follow the same instructions as above, it doesn't open a console window anymore. It used to work before I reimage my computer and updated to the new Visual Studio version.

Am I missing something?


Original Comments

Feedback Bot on 12/16/2020, 07:24 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.


Original Solutions

Jeroen WELLEN solved on 2/2/2021, 07:06 AM, 0 votes:

https://www.codeproject.com/Tips/68979/Attaching-a-Console-to-a-WinForms-application

@reflectronic
Copy link

See also dotnet/sdk#15554 dotnet/sdk#13624 dotnet/sdk#13331 dotnet/sdk#14503. The default was intentionally changed, although the SDK should probably respect an explicit choice in the project file.

@daisyTian0517
Copy link

daisyTian0517 commented Feb 11, 2021

Please add <DisableWinExeOutputInference>true</DisableWinExeOutputInference> to your to .csproj as below:

<PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net5.0-windows</TargetFramework>
    <UseWPF>true</UseWPF>
   <DisableWinExeOutputInference>true</DisableWinExeOutputInference>
  </PropertyGroup>

You can refer to OutputType set to WinExe for WPF and WinForms apps for more detailed info.

@ryalanms
Copy link
Member

Thanks. everyone. @daisyTian0517, I believe your recommendation should solve the problem.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants