Napotkałem dzisiaj w aplikacji ciekawy problem. Mianowicie, wszystko na localhoście działa aż miło, problem pojawił się po publikacji na hostingu. Otóż, mam metode, która na podstawie danych wejściowych z bazy danych parsuje to na klase DataTime. Zarówno na localu jak i na hostingu korzystam z tej samej bazy. Jak można zauważyć, dane są identyczne, jednak tutaj wyjątek się nie pojawia, a tam się pojawia. Proszę o pomoc.
To localhost jak widać po debugu
A to część logów powyższego kodu z hostingu
DEBUG 2020-04-17 00:08:09,056 363393ms ManageController ntNewNotifications - 04/16/20 14:14:40
DEBUG 2020-04-17 00:08:09,087 363425ms ManageController ntNewNotifications - 04/16/20 14:14:39
ERROR 2020-04-17 00:08:09,087 363425ms ManageController ntNewNotifications - System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at ASP._Page_Areas_Admin_Views_Manage_Index_cshtml._CountNewNotifications()
DEBUG 2020-04-17 00:08:09,087 363425ms ManageController ntNewNotifications - 04/16/20 14:14:40
DEBUG 2020-04-17 00:08:09,087 363425ms ManageController ntNewNotifications - 04/16/20 14:14:39
ERROR 2020-04-17 00:08:09,087 363425ms ManageController ntNewNotifications - System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at ASP._Page_Areas_Admin_Views_Manage_Index_cshtml._CountNewNotifications()
DEBUG 2020-04-17 00:08:09,087 363425ms ManageController ntNewNotifications - 04/16/20 14:14:41
DEBUG 2020-04-17 00:08:09,087 363425ms ManageController ntNewNotifications - 04/16/20 14:14:39
ERROR 2020-04-17 00:08:09,087 363425ms ManageController ntNewNotifications - System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at ASP._Page_Areas_Admin_Views_Manage_Index_cshtml._CountNewNotifications()
DEBUG 2020-04-17 00:08:09,087 363425ms ManageController ntNewNotifications - 04/16/20 14:14:41
DEBUG 2020-04-17 00:08:09,087 363425ms ManageController ntNewNotifications - 04/16/20 14:14:39
ERROR 2020-04-17 00:08:09,087 363425ms ManageController ntNewNotifications - System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at ASP._Page_Areas_Admin_Views_Manage_Index_cshtml._CountNewNotifications()
DEBUG 2020-04-17 00:08:09,087 363425ms ManageController ntNewNotifications - 04/16/20 14:14:41
DEBUG 2020-04-17 00:08:09,087 363425ms ManageController ntNewNotifications - 04/16/20 14:14:39
ERROR 2020-04-17 00:08:09,087 363425ms ManageController ntNewNotifications - System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at ASP._Page_Areas_Admin_Views_Manage_Index_cshtml._CountNewNotifications()
DEBUG 2020-04-17 00:08:09,087 363425ms ManageController ntNewNotifications - 04/16/20 14:14:41
DEBUG 2020-04-17 00:08:09,087 363425ms ManageController ntNewNotifications - 04/16/20 14:14:39
ERROR 2020-04-17 00:08:09,087 363425ms ManageController ntNewNotifications - System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at ASP._Page_Areas_Admin_Views_Manage_Index_cshtml._CountNewNotifications()
DEBUG 2020-04-17 00:08:09,087 363425ms ManageController ntNewNotifications - 04/16/20 14:14:42
DEBUG 2020-04-17 00:08:09,087 363425ms ManageController ntNewNotifications - 04/16/20 14:14:39
ERROR 2020-04-17 00:08:09,103 363440ms ManageController ntNewNotifications - System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at ASP._Page_Areas_Admin_Views_Manage_Index_cshtml._CountNewNotifications()
DEBUG 2020-04-17 00:08:09,103 363440ms ManageController ntNewNotifications - 04/16/20 14:14:42
DEBUG 2020-04-17 00:08:09,103 363440ms ManageController ntNewNotifications - 04/16/20 14:14:39
ERROR 2020-04-17 00:08:09,103 363440ms ManageController ntNewNotifications - System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at ASP._Page_Areas_Admin_Views_Manage_Index_cshtml._CountNewNotifications()
DEBUG 2020-04-17 00:08:09,103 363440ms ManageController ntNewNotifications - 04/16/20 14:14:42
DEBUG 2020-04-17 00:08:09,103 363440ms ManageController ntNewNotifications - 04/16/20 14:14:39
ERROR 2020-04-17 00:08:09,103 363440ms ManageController ntNewNotifications - System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at ASP._Page_Areas_Admin_Views_Manage_Index_cshtml._CountNewNotifications()
DEBUG 2020-04-17 00:08:09,103 363440ms ManageController ntNewNotifications - 04/16/20 14:14:43
DEBUG 2020-04-17 00:08:09,103 363440ms ManageController ntNewNotifications - 04/16/20 14:14:39
ERROR 2020-04-17 00:08:09,103 363440ms ManageController ntNewNotifications - System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at ASP._Page_Areas_Admin_Views_Manage_Index_cshtml._CountNewNotifications()
DEBUG 2020-04-17 00:08:09,103 363440ms ManageController ntNewNotifications - 04/16/20 14:14:43
DEBUG 2020-04-17 00:08:09,103 363440ms ManageController ntNewNotifications - 04/16/20 14:14:39
ERROR 2020-04-17 00:08:09,103 363440ms ManageController ntNewNotifications - System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at ASP._Page_Areas_Admin_Views_Manage_Index_cshtml._CountNewNotifications()
DEBUG 2020-04-17 00:08:09,103 363440ms ManageController ntNewNotifications - 04/16/20 14:14:43
DEBUG 2020-04-17 00:08:09,103 363440ms ManageController ntNewNotifications - 04/16/20 14:14:39
ERROR 2020-04-17 00:08:09,103 363440ms ManageController ntNewNotifications - System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at ASP._Page_Areas_Admin_Views_Manage_Index_cshtml._CountNewNotifications()
DEBUG 2020-04-17 00:08:09,103 363440ms ManageController ntNewNotifications - 04/16/20 14:14:43
DEBUG 2020-04-17 00:08:09,103 363440ms ManageController ntNewNotifications - 04/16/20 14:14:39
ERROR 2020-04-17 00:08:09,103 363440ms ManageController ntNewNotifications - System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at ASP._Page_Areas_Admin_Views_Manage_Index_cshtml._CountNewNotifications()
DEBUG 2020-04-17 00:08:09,103 363440ms ManageController ntNewNotifications - 04/16/20 14:14:44
DEBUG 2020-04-17 00:08:09,103 363440ms ManageController ntNewNotifications - 04/16/20 14:14:39
ERROR 2020-04-17 00:08:09,103 363440ms ManageController ntNewNotifications - System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at ASP._Page_Areas_Admin_Views_Manage_Index_cshtml._CountNewNotifications()
DEBUG 2020-04-17 00:08:09,103 363440ms ManageController ntNewNotifications - 04/16/20 14:14:44
DEBUG 2020-04-17 00:08:09,103 363440ms ManageController ntNewNotifications - 04/16/20 14:14:39
ERROR 2020-04-17 00:08:09,103 363440ms ManageController ntNewNotifications - System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at ASP._Page_Areas_Admin_Views_Manage_Index_cshtml._CountNewNotifications()
DEBUG 2020-04-17 00:08:09,103 363440ms ManageController ntNewNotifications - 04/16/20 14:14:44
DEBUG 2020-04-17 00:08:09,103 363440ms ManageController ntNewNotifications - 04/16/20 14:14:39
ERROR 2020-04-17 00:08:09,103 363440ms ManageController ntNewNotifications - System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at ASP._Page_Areas_Admin_Views_Manage_Index_cshtml._CountNewNotifications()
DEBUG 2020-04-17 00:08:09,103 363440ms ManageController ntNewNotifications - 04/16/20 14:14:45
DEBUG 2020-04-17 00:08:09,103 363440ms ManageController ntNewNotifications - 04/16/20 14:14:39
ERROR 2020-04-17 00:08:09,103 363440ms ManageController ntNewNotifications - System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at ASP._Page_Areas_Admin_Views_Manage_Index_cshtml._CountNewNotifications()
DEBUG 2020-04-17 00:08:09,118 363456ms ManageController ntNewNotifications - 04/16/20 14:14:45
DEBUG 2020-04-17 00:08:09,118 363456ms ManageController ntNewNotifications - 04/16/20 14:14:39
ERROR 2020-04-17 00:08:09,118 363456ms ManageController ntNewNotifications - System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at ASP._Page_Areas_Admin_Views_Manage_Index_cshtml._CountNewNotifications()
DEBUG 2020-04-17 00:08:09,118 363456ms ManageController ntNewNotifications - 04/16/20 14:14:45
DEBUG 2020-04-17 00:08:09,118 363456ms ManageController ntNewNotifications - 04/16/20 14:14:39
ERROR 2020-04-17 00:08:09,118 363456ms ManageController ntNewNotifications - System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at ASP._Page_Areas_Admin_Views_Manage_Index_cshtml._CountNewNotifications()
DEBUG 2020-04-17 00:08:09,118 363456ms ManageController ntNewNotifications - 04/16/20 14:14:46
DEBUG 2020-04-17 00:08:09,118 363456ms ManageController ntNewNotifications - 04/16/20 14:14:39
ERROR 2020-04-17 00:08:09,118 363456ms ManageController ntNewNotifications - System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at ASP._Page_Areas_Admin_Views_Manage_Index_cshtml._CountNewNotifications()
DEBUG 2020-04-17 00:08:09,118 363456ms ManageController ntNewNotifications - 04/16/20 14:14:46
DEBUG 2020-04-17 00:08:09,118 363456ms ManageController ntNewNotifications - 04/16/20 14:14:39
ERROR 2020-04-17 00:08:09,118 363456ms ManageController ntNewNotifications - System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at ASP._Page_Areas_Admin_Views_Manage_Index_cshtml._CountNewNotifications()
DEBUG 2020-04-17 00:08:09,118 363456ms ManageController ntNewNotifications - 04/16/20 14:14:47
DEBUG 2020-04-17 00:08:09,118 363456ms ManageController ntNewNotifications - 04/16/20 14:14:39
ERROR 2020-04-17 00:08:09,118 363456ms ManageController ntNewNotifications - System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at ASP._Page_Areas_Admin_Views_Manage_Index_cshtml._CountNewNotifications()
DEBUG 2020-04-17 00:08:09,118 363456ms ManageController ntNewNotifications - 04/16/20 14:14:47
DEBUG 2020-04-17 00:08:09,118 363456ms ManageController ntNewNotifications - 04/16/20 14:14:39
ERROR 2020-04-17 00:08:09,118 363456ms ManageController ntNewNotifications - System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at ASP._Page_Areas_Admin_Views_Manage_Index_cshtml._CountNewNotifications()
DEBUG 2020-04-17 00:08:09,118 363456ms ManageController ntNewNotifications - 04/16/20 14:14:47
DEBUG 2020-04-17 00:08:09,118 363456ms ManageController ntNewNotifications - 04/16/20 14:14:39
ERROR 2020-04-17 00:08:09,118 363456ms ManageController ntNewNotifications - System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at ASP._Page_Areas_Admin_Views_Manage_Index_cshtml._CountNewNotifications()
DEBUG 2020-04-17 00:08:09,118 363456ms ManageController ntNewNotifications - 04/16/20 14:14:47
DEBUG 2020-04-17 00:08:09,118 363456ms ManageController ntNewNotifications - 04/16/20 14:14:39
ERROR 2020-04-17 00:08:09,118 363456ms ManageController ntNewNotifications - System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at ASP._Page_Areas_Admin_Views_Manage_Index_cshtml._CountNewNotifications()
DEBUG 2020-04-17 00:08:09,118 363456ms ManageController ntNewNotifications - 04/16/20 14:14:48
DEBUG 2020-04-17 00:08:09,118 363456ms ManageController ntNewNotifications - 04/16/20 14:14:39
ERROR 2020-04-17 00:08:09,118 363456ms ManageController ntNewNotifications - System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at ASP._Page_Areas_Admin_Views_Manage_Index_cshtml._CountNewNotifications()
DEBUG 2020-04-17 00:08:09,118 363456ms ManageController ntNewNotifications - 04/16/20 14:14:48
DEBUG 2020-04-17 00:08:09,118 363456ms ManageController ntNewNotifications - 04/16/20 14:14:39
ERROR 2020-04-17 00:08:09,118 363456ms ManageController ntNewNotifications - System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at ASP._Page_Areas_Admin_Views_Manage_Index_cshtml._CountNewNotifications()
DEBUG 2020-04-17 00:08:09,118 363456ms ManageController ntNewNotifications - 04/16/20 14:14:48
DEBUG 2020-04-17 00:08:09,118 363456ms ManageController ntNewNotifications - 04/16/20 14:14:39
ERROR 2020-04-17 00:08:09,118 363456ms ManageController ntNewNotifications - System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at ASP._Page_Areas_Admin_Views_Manage_Index_cshtml._CountNewNotifications()
DEBUG 2020-04-17 00:08:09,118 363456ms ManageController ntNewNotifications - 04/16/20 14:14:49
DEBUG 2020-04-17 00:08:09,118 363456ms ManageController ntNewNotifications - 04/16/20 14:14:39
ERROR 2020-04-17 00:08:09,118 363456ms ManageController ntNewNotifications - System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at ASP._Page_Areas_Admin_Views_Manage_Index_cshtml._CountNewNotifications()
DEBUG 2020-04-17 00:08:09,134 363472ms ManageController ntNewNotifications - 04/16/20 14:14:49
DEBUG 2020-04-17 00:08:09,134 363472ms ManageController ntNewNotifications - 04/16/20 14:14:39
ERROR 2020-04-17 00:08:09,134 363472ms ManageController ntNewNotifications - System.FormatException: String was not recognized as a valid DateTime.