I have a website developed in ASP.Net, using Web Forms, running and it works perfectly 99% of the time, but sometimes I notice that the website is down.
I've managed to get the error message a page method is returning when I enter the website.
{"Message":"Object reference not set to an instance of an object .","StackTrace":" em MySql.Data.MySqlClient.NativeDriver.ExecuteCommand(DBCmd cmd, Byte[] bytes, Int32 length)\r\n em MySql.Data.MySqlClient.NativeDriver.Query(Byte[] bytes, Int32 length)\r\n em MySql.Data.MySqlClient.Statement.ExecuteNext()\r\n em MySql.Data.MySqlClient.PreparableStatement.ExecuteNext()\r\n em MySql.Data.MySqlClient.PreparableStatement.Execute()\r\n em MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)\r\n em MySql.Data.MySqlClient.MySqlCommand.ExecuteDbDataReader(CommandBehavior behavior)\r\n em System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)\r\n em System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)\r\n em System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)\r\n em System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)\r\n em Impalce.ConexaoMySQL.ConsultarVarios(String[] sqls, List`1 parametros, Int32 tempotimeout)\r\n em Impalce.ConexaoMySQL.ConsultarVarios(String[] sqls)\r\n em _Default.CarregarTela()","ExceptionType":"System.NullReferenceException"}
The only way I managed to solve this was renaming the web.config file to something like "_web.config" and then renaming it again to "web.config".
Any ideas on how can I properly identify what is causing this problem and why renaming the web.config file "solves" it?
Like I said, the site works 99% of the time and this occurs, apparently, at random moments (I haven't identified an unsual amount of users or any other connection problems).
Any insights on why this is happening or how can I identify the problem are welcome.
Thanks in advance.