System.Debug 和 System.Threading 引用错误
错误信息 'ThreadState' 是 'System.Threading.ThreadState' 和 'System.Diagnostics.ThreadState' 之间的不明确引用
我正在尝试调试 C# 类 .cs 并使用 Debug.Writeline 进行代码调试...
但收到上面的错误!!
还有其他方法来调试 C# 代码类吗?我尝试了 Console.Writeline() 、 Alert.Show 和 Message.Show ,但没有找到另一种有效的方法来调试 Web 应用程序 C# 类或解决不明确的引用!
Error Message
'ThreadState' is an ambiguous reference between 'System.Threading.ThreadState' and 'System.Diagnostics.ThreadState'
I am trying to debug C# Class .cs and am using Debug.Writeline for code debugging...
But am getting an error above!!
Is there another way to debug C# Code Classes ? I tried Console.Writeline() and Alert.Show and Message.Show and have not found another effective way to debug web application C# classes or way around the ambiguous reference !!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对有问题的枚举使用完全限定名称,或者根本不执行
using System.Diagnostics
(并完全限定System.Diagnostics.Debug.WriteLine()
调用反而)。Use fully qualified names for the offending enum, or don't do a
using System.Diagnostics
at all (and fully qualify theSystem.Diagnostics.Debug.WriteLine()
calls instead).您可以通过执行以下操作来解决此问题。将此 using 语句放在所有其他 using 语句附近:
现在在您的代码上使用 TheThreadState。
You can solve this by doing as follows. Put this using statement near all your other using statements:
Now use TheThreadState on you code.