toString()方法返回null?方法、toString、null

由网友(妹紙跟爺笑一下)分享简介:我想确定公布的远程站点空引用异常的原因。所以,我不能直接进行调试,因此只能与日志操作。所以我的问题是:有没有可能,即的ToString()的任何方法内置.NET类型返回空? I am trying to determine cause of 'Null reference exception' on publish...

我想确定公布的远程站点空引用异常的原因。所以,我不能直接进行调试,因此只能与日志操作。所以我的问题是: 有没有可能,即的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.

阅读全文

相关推荐

最新文章