C# - 如何在代码中打印行来告诉你你在哪里 [英] C# -- How to Print Lines in Code to Tell You Where You Are
问题描述
Hi,
有谁知道如何获得在调试C#时,Console.WriteLine()和/或Debug.WriteLine()是否有效?特别是,它是一个dll依赖项中的Console.WriteLine,而不是主程序本身。
Does anyone know how to get the Console.WriteLine() and/or the Debug.WriteLine() to work when you are debugging C#? In particular, it is the Console.WriteLine in a dll dependency, not in the main program itself.
我得到的只是一个弹出窗口,上面写着"未找到Console.cs"。
All I ever get is a popup that says "Console.cs not found".
我的程序有一个控制台。为什么我不能将消息打印到运行程序时打开的控制台?这是不可能的吗?
My program has a console. Why can't I just print the message out to the console that opens when I run the program? Is that not possible?
谢谢!
Croix
g
推荐答案
您好Croix,
Hi Croix,
感谢您的发布。
请问您正在开发什么样的项目?
May I ask what kind of project you are developing?
如果它是类库,我们将无法编写Console.WriteLine(),我们可以在
控制台应用:
If it's a Class library we won't be able to write the Console.WriteLine(), and we can do it in Console App instead:
如果我误解了,请随时告诉我。
Please feel free to let me know if I misunderstood it.
祝你好运,
Fletcher
这篇关于C# - 如何在代码中打印行来告诉你你在哪里的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!