gpt4 book ai didi

c# - 调试时跳过 Debug.WriteLine

转载 作者:太空狗 更新时间:2023-10-29 18:20:27 24 4
gpt4 key购买 nike

我正在编写一个简单的 C# 代码,但是 Debug.WriteLine(".."); 出现的部分被跳过了。例如:

WebClient wc = new WebClient();

wc.Encoding = System.Text.Encoding.GetEncoding("ISO-8859-1");
wc.DownloadStringCompleted += new DownloadStringCompletedEventHandler(SearchWordsDownloaded);

Debug.WriteLine("test");
wc.DownloadStringAsync(new Uri("SomeURL"));

为什么会这样?

最佳答案

我看到了这个 - Debug.WriteLine() 语句被跳过以用于附加调试器的调试构建。不知道为什么,但未设置 DEBUG 编译符号。转到项目属性页面的构建部分,然后在“条件编译符号”字段中输入“DEBUG”(不带引号)。这导致调试器再次开始输入调试语句。

关于c# - 调试时跳过 Debug.WriteLine,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12762756/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com