toString()方法返回null? [英] ToString() returns null?
问题描述
我想确定公布的远程站点空引用异常的原因。所以,我不能直接进行调试,因此只能与日志操作。所以我的问题是:
有没有可能,即的ToString()
的任何方法内置.NET类型返回空
?
I am trying to determine cause of 'Null reference exception' on published remote site. So, I can't debug it directly and can operate only with logs. So my question is:
Is it possible, that .ToString()
method of any of built-in .NET types returns null
?
编辑:
我怀疑则DateTime.ToString(InvariantCulture的)
法严重构建区域性设置。
I suspect DateTime.ToString(invariantCulture)
method with badly constructed culture settings.
推荐答案
我不知道它做任何类型的。这不是不可能的 - 它肯定会很容易编写自己的类型,表现得那样 - 但我的疑问的任何类型做框架
I don't know of any types where it does. It's not impossible - it would certainly be easy to write your own type which behaved like that - but I doubt any of the framework types do.
你有什么特定类型的想法?
Do you have any particular types in mind?
编辑:则DateTime.ToString(InvariantCulture的)
应的永远的回空 - 文化的设置应该是不相关的,如果你的真正的得到了不变的文化。
DateTime.ToString(invariantCulture)
should never return null - the culture settings should be irrelevant, if you've really got the invariant culture.
这篇关于toString()方法返回null?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!