Open jonathanpeppers opened 6 months ago
I face the same issue when debugging .NET MAUI on iOS.
It's the expected behaviour.
You should use Debug.WriteLine("xxxx)
to output to the "vs code debug console".
"Console.WriteLine" is designed for console environment , not "deug console"
I think this issue could be closed.
@hugebug4ever Console.WriteLine()
has always appeared in IDEs for applications running on the Mono runtime: iOS, Android, MacCatalyst.
I wouldn't expect this behavior in VS Code should differ from VS Mac or VS Windows?
@jonathanpeppers sorry for my reckless, I didn't notice you are from official team.
I have just adapted to "console to console window" and "debug to debug window". It behaved the same with latest dotnet core application with vs2022.
Just wondering why should we pipe the Console.WriteLine to Debug window, but not a separate console window ? To me, this way is
more clear.
What you are describing is definitely what happens on Windows (WinUI3, MAUI, etc.). I agree with that.
I don't know if we can change the behavior for .NET mobile at this point, as it has been this way since Xamarin, .NET 6, 7, 8, 9.
@rolfbjarne might have an opinion about what it should do. But I would think they want to see both NSLog()
messages and Console.WriteLine()
messages? We would also want Android.Util.Log.Debug()
messages to show on Android.
@rolfbjarne might have an opinion about what it should do. But I would think they want to see both
NSLog()
messages andConsole.WriteLine()
messages? We would also wantAndroid.Util.Log.Debug()
messages to show on Android.
IMO Console[.Error].Write*
output should be visible somewhere from inside VS Code. If that's the "Debug console", or some other pad, I don't particularly care.
FWIW macOS / iOS forwards anything written using NSLog
to stderr, so showing stderr takes care of that.
Describe the Issue
If I add
Console.WriteLine("Hello!")
in a .NET MAUI application running on macOS, I don't see the message in VS Code's "Debug Console".However, if I run the app such as:
Then I see the message.
Steps To Reproduce
dotnet new maui
Console.WriteLine("Hello!")
somewhere in the appExpected Behavior
I can see CWL messages in the "Debug Console" window.
Environment Information