Cause:
- A security vulnerability in the older PHP version required a PHP update. Although updating PHP separately in the existing XAMPP installation was possible, it was complex, so a complete XAMPP update was chosen for simplicity.
- Updating the complete XAMPP distribution also upgraded MariaDB to 10.11, making the database server update a secondary consequence of the PHP security update.
- MySql.Data 6.6.5 failed while loading character sets from MariaDB 10.11, throwing an InvalidCastException when converting DBNull to an integer.
- SessionFactory creation displayed only the outer exception message, hiding the actual connection failure.
- After SessionFactory creation failed, TBF called OpenSession() on a null reference, causing a secondary NullReferenceException.
Solution:
1. Update the MySQL database driver
- Replace MySql.Data 6.6.5 references with MySql.Data 9.3.0 PackageReference entries across all 15 referencing projects.
- Enable automatic binding redirects to resolve dependency version differences.
- Remove the obsolete MySql.Data entry from TBF/packages.config.
2. Preserve database connection errors
- Include the underlying exception message when reporting SessionFactory creation failures.
- Propagate startup connection failures to the existing TBF error handler instead of returning a null SessionFactory.
- Preserve the original exception chain for diagnostics.
3. Increased revision
- Updated AssemblyVersion and AssemblyFileVersion from 3.9.3147.121 to 3.9.3147.125.