I just pushed the site to production, which worked fine in the QA environment. The patch included DLL dependency updates and some database scripts.
I will move on to the persecution and explain the mistake that took me 4 hours to understand. One of my database scripts created a stored procedure that was not [dbo] before its name. Therefore, instead of becoming [dbo]. [MyProcedure], he became [shawn]. [MyProcedure]. When the script was executed from code through the System.Data.SqlClient library, it killed the entire ASP.NET workflow. This caused the application to restart and redirect back to the login screen. The procedure was called conditionally and rather rarely, so it is difficult to reproduce.
Since he pulled out the entire ASP.NET workflow, it was very difficult to debug. I did not have the opportunity to catch a mistake. In the end, I noticed this in the Windows event log:
Exception: System.Runtime.Serialization.SerializationException Message: Unable to find assembly 'Shawn.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null'.
(Note: the root namespace has been renamed to protect the innocent.)
And then, after 2 seconds:
EventType clr20r3, P1 w3wp.exe, P2 6.0.3790.3959, P3 45d6968e, P4 mscorlib, P5 2.0.0.0, P6 4889dc80, P7 4687, P8 4b, P9 shawn.data.dataaccess, P10 NIL.
At this point, I realized that it was an inconsistent version of the assembly, a GAC conflict? or something similar. I checked every link in my entire project and tried many different things. In the end, I looked for all the references to the Shawn.Data.DataAccess namespace and wrote to the file every few lines to find where the application fails. This led me to the right stored procedure.
TLDR : why the lack of [dbo] on one script causes the whole ASP.NET workflow to crash?