0

I have an WPF application that uses SQLite. The application has work for at least 2-3 years.

Now the user wants a change in the application which has nothing todo with SQLite.

I'm using .NET 4.7.2 This has not changed!

I made the change and now I can't create a connection to the database! The application crashes without any clue on this line

var connection = new SQLiteConnection("Data Source=c:\\ProgramData\\DC Lasersystem\\DCMatrixPlus\\Order.db");

I was using

SQLite 3.13.0
System.Data.SQLite.Core 1.0.111
System.Data.SQLite.Linq 1.0.111

I have not changed anything in the SQLite code. But I have updated Windows 10 Pro to

Version 21H2
Installed on ‎2022-‎05-‎06
OS build 19044.2075 Experience Windows Feature Experience Pack 120.2212.4180.0

Can't remember which version I had when it worked. It was Windows 10 Pro....

I have also updated Visual Studio 2017 to (and here also I don't remember which version worked. It was 2017)

Microsoft Visual Studio Community 2017      
Version 15.9.50
VisualStudio.15.Release/15.9.50+28307.2094  
Microsoft .NET Framework
Version 4.8.04084
 
Installed Version: Community

I figured it to be an update that SQLite version 1.0.111 didn't like so I updated it to 1.0.116

Still get the same error. A crash but no information.

Event Viewer give this information

Faulting application name: DCMatrixPlus.exe, version: 1.0.5.5, time stamp: 0xa6d32e45
Faulting module name: ntdll.dll, version: 10.0.19041.2075, time stamp: 0x0fcecfa3
Exception code: 0xc0000374
Fault offset: 0x000e7133
Faulting process id: 0x87c
Faulting application start time: 0x01d8da4c1156a5aa
Faulting application path: E:\Source\repos\Seco Tools\DCMatrixPlus\DCMatrix\bin\x86\Debug\DCMatrixPlus.exe
Faulting module path: C:\WINDOWS\SYSTEM32\ntdll.dll
Report Id: 31b608cd-26e5-46f8-ad7d-48c8d491a104
Faulting package full name: 
Faulting package-relative application ID: 

I also have a report.wer file if it will be needed....

Lance U. Matthews
  • 15,725
  • 6
  • 48
  • 68
  • Hi @Anders! in the connection string, your DB path was absolute, but the execution path is different in your error message! Do you check this? – Hadi Oct 07 '22 at 13:59
  • Hello @Hadi. The database (Order.db) is located in c:\\ProgramData\\DC Lasersystem\\DCMatrixPlus but the program is located in E:\Source\repos\Seco Tools\DCMatrixPlus\DCMatrix\bin\x86\Debug\DCMatrixPlus.exe – Anders Eriksson Oct 07 '22 at 14:25
  • The error you are getting in ntdll.dll seems to be caused by heap corruption based on a google search. Here are some steps to try to find what may be behind it: https://stackoverflow.com/questions/53727265/unexplained-crashes-related-to-ntdll-dll and https://social.msdn.microsoft.com/Forums/en-US/dc85650f-b88b-40f3-8125-8c3eb2df6215/application-crashes-with-faulting-module-name-ntdlldll-version-100143932608-time-stamp?forum=csharpgeneral – Anthony G. Oct 07 '22 at 15:24
  • Hello! I have "solved" the problem! I have an ActiveX/COM server that works best when my program is compiled for x86. When I changed to x64 SQLite started working! Don't know why. I'm using System.Data.SQLite.Core which create both x85 and x64 versions of SQlite.Interop.dll. They are located in program\bin\x64\Release\x64 or x86 I never got any complain about using a dll for the wrong version. If someone has an idea it would be nice to now how the different dll version are loaded – Anders Eriksson Oct 09 '22 at 21:58

0 Answers0