Session and Application variables lost using SQLite and ASP.Net
After many hours of debbuging I finally found out why my application and session variables were reset when a postback was executed in my ASP.Net application. Because it was an application upgrade, going from desktop to webforms I was still using the original SQLite database.
There’s an interesting thing in ASP.Net applications, that is documented, but most of the times is forgotten, and that is when a file in the /bin folder is modified, then the application is reset by IIS (or ASP.Net development server). So, in the postback operation there was an INSERT statement, and my mistake was having the SQLite database file within the /bin folder, and not in the AppData folder. Of course, until this moment I didn’t found a reason why ASP.Net apps needed an special folder for the datafiles, well, I’ve learned the hard way.