问题
I have a simple Xamarin.Forms project that I'm running in Visual Studio, using an iphone emulator. I have the following code in App.cs:
protected override void OnStart()
{
Debug.WriteLine("---------- OnStart called!");
}
Where exactly is that supposed to output to? I don't see it in any of the Visual Studio output windows (Build, Build Order, Debug, Xamarin, Xamarin Diagnostics).
回答1:
Using Console.WriteLine()
works with Device Log. Also you can filter out all device log with mono-stdout
tag.
回答2:
It should be on the device log, for example on Android you can use the Android Device Monitor to see the message, You can always use Console.Writeline()
to see those messages on the debug console.
回答3:
It will be coming in application output window. if it is not open automatically, you can go to view -> Pads -> Application Output. This was about mac visual studio. i am not sure about windows.
来源:https://stackoverflow.com/questions/35847530/xamarin-forms-debug-writeline-where-does-the-output-go