繁体   English   中英

Debug.WriteLine(“Hello World!”) - 没有出现在 output 中

[英]Debug.WriteLine(“Hello World!”) - Does not appear in the output

问题

我正在开发一个UWP通用 Windows 平台)应用程序,作为测试我包括

Debug.WriteLine("Hello World;"); 方法,但在 output 中,方法中输入的文本未显示。

问题

该方法是否被我错误地集成到 UWP 应用程序中?

源代码

using System;
using System.Diagnostics;
using Windows.System;
using Windows.UI.ViewManagement;
using Windows.UI.Xaml.Controls;

// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409

namespace UwpApplication1
{
    /// <summary>
    ///     An empty page that can be used on its own or navigated to within a Frame.
    /// </summary>
    public sealed partial class MainPage : Page
    {
        public MainPage()
        {
            
            Debug.WriteLine("Hello World! - Debug.Writeline() Test");

        }
    }
}

如果您希望在 Visual Studio output 而不是 UWP 应用程序中显示“ Hello, World ”,您只需编写Console.WriteLine()而不是Debug.WriteLine()

如果您希望它显示在 UWP 应用程序中,您可以创建一个文本块(无代码)。 在调试中写入“Hello, World!”只会在 output 中显示用户在实际应用中看不到的注释。

如果你想要一个控制台 output 只需输入Console.WriteLine()

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM