【发布时间】:2018-06-13 22:42:18
【问题描述】:
如标题所示,我正在尝试通过以 xamarin 形式写入控制台来调试我的程序。我曾多次尝试过 System.Diagnostics.Debug.WriteLine 和 Console.WriteLine,它们都没有我可以在调试输出或设备日志中看到的任何输出。
编辑:
在以下代码的 Visual Studio 调试输出中看不到任何输出。
using CustomRenderer;
using System;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace CarpApp
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class MainPage : ContentPage
{
private static ILogger logger = DependencyService.Get<ILogManager>().GetLog();
public MainPage()
{
InitializeComponent();
logger.Trace("Test1");
System.Diagnostics.Debug.WriteLine("Test2");
}
private void OnMessagesTapped(object sender, EventArgs args)
{
System.Diagnostics.Debug.WriteLine("Test3");
Console.WriteLine("Test4");
logger.Trace("Test5");
}
private void OnFindTapped(object sender, EventArgs args)
{
Navigation.PushAsync(new MapPage());
}
private void OnGetRidTapped(object sender, EventArgs args)
{
Navigation.PushAsync(new GetRidPage());
}
}
}
【问题讨论】:
-
你能分享代码示例吗?
-
抱歉这个琐碎的问题,但是您是在 debug 中而不是在 release 中运行您的应用程序吗?它只适用于 debug
-
是的,它正在调试中运行,但我觉得它可能很简单。
标签: xamarin xamarin.forms output