为什么服务器使用一段时间,我的网站浏览网页的时候就会出现String was not recognized as a valid DateTime 的错误?然后我重启下IIS,就会好上一段时间,这个时间可能是几小时,也可能是几天。百度了下都说是时间设置问题,按照百度上说的把时间设置了一遍也无法解决,我觉得不是时间设置问题,如果时间设置有问题,那应该是直接就会出现这个错误,而不是隔段时间出现。大神们有遇到这个问题的吗?请帮助解决下
解决方案 »
- MVC 下使用Jquery怎么在JS代码中实现文件下载?
- 为什么小于10的数除以10都等于0呢?
- 数据库监测
- 请问各位高手,我要通过80端品访问一个.NET1.1的网站和一个.NTE2.0的网站要怎么设置?
- 两个TextBox分别输入10%、20%,然后1减去它们,结果自动显示在Label中。。。。。。
- 很急的问题,应该不难
- 一个TexTBox问题
- 有关NHibernate的插入、更新问题,高手进来瞧瞧好吗?
- 向ASPX页面中添加控件的问题。急呀!!!!
- w3wp.exe和aspnet_wp.exe进程有什么不同?
- asp.net 新网域名注册查询接口!谁有
- 定时读取sql2005数据库生成json文件
关键看错误出在哪
把网页调试打开
如果有错误,网页上会显示出错的源代码处
String was not recognized as a valid DateTime.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.FormatException: String was not recognized as a valid DateTime.Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace: [FormatException: String was not recognized as a valid DateTime.]
System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) +2271682
System.DateTime.Parse(String s) +22
KeLin.ClassManager.DAL.class_DAL.GetModel(Int64 siteid, Int64 classid) +2630
KeLin.ClassManager.Tool.WapTool.getClassInfo(String siteid, String classid) +82
KeLin.WebSite.PageWap.a(Object A_0, EventArgs A_1) +15207
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061
System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) +2271682
System.DateTime.Parse(String s) +22
KeLin.ClassManager.DAL.class_DAL.GetModel(Int64 siteid, Int64 classid) +2630
KeLin.ClassManager.Tool.WapTool.getClassInfo(String siteid, String classid) +82
KeLin.WebSite.PageWap.a(Object A_0, EventArgs A_1) +15207
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061写的明明白白,非要说是iis的问题。如果说iis报一堆完全不着调的东西么,你说是iis的问题还能说过去,你这里都出现[FormatException: String was not recognized as a valid DateTime.]
System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) +2271682
System.DateTime.Parse(String s) +22
KeLin.ClassManager.DAL.class_DAL.GetModel(Int64 siteid, Int64 classid) +2630
KeLin.ClassManager.Tool.WapTool.getClassInfo(String siteid, String classid) +82
KeLin.WebSite.PageWap.a(Object A_0, EventArgs A_1) +15207
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061, KeLin.ClassManager.DAL.class_DAL.GetMode
还要硬说是IIS的问题,这个锅微软不背
我没说是IIS问题啊,我只是说重启下IIS就好了。我是想问这个到底是什么问题?要怎么解决?
KeLin.ClassManager.DAL.class_DAL.GetModel(Int64 siteid, Int64 classid) +2630
KeLin.ClassManager.Tool.WapTool.getClassInfo(String siteid, String classid) +82
已经帮你标出了,版主让你调整系统的区域选项,无效回答。OnLoad--------》ClassInfo---------》DAL.GetModel---------》DateTimeParse.Parse详细看为啥如此,调整系统的区域选项,是无效回答
KeLin.ClassManager.Tool.WapTool.getClassInfo(String siteid, String classid) +82 这一句提示了System.DateTimeParse.Parse 看下这块啊。 很明显的
static ExJsonConvert()
{
TimeFormat = new IsoDateTimeConverter
{
DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
}
转换一下