toString()方法返回null? [英] ToString() returns null?

查看:255
本文介绍了toString()方法返回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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆