Hello @Lloyd Sheen ,
Welcome to Microsoft Q&A forum.
My understanding win app
is just a category of project types including WinForms, WPF, WinUI etc. I tested WinUI app
as an example based on your previous issues. I reproduced the issue in WinUI project in VS2022.
Actually, the Console.WriteLine
isn’t for IDE output windows. It writes to console. But, as you know, the default output type for WinUI is windows application. Here’re some workarounds, you can try to achieve it:
- If you want to use
Debug.WriteLine
to output ,you should build in debug mode. It will show the message/text in your output window that show output fromDebug
at the bottom of Visual Studio.
Example
System.Diagnostics.Debug.WriteLine("I am using debugging");
- if you want to use
Console.WriteLine()
, here’s a simple way:
Right click project and then select : Project Properties -> Application -> Output Type -> Console Application. It can show output in console window.
example
Console.WriteLine("3233");
Result
Best Regards,
Tianyu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.