Я пробовал менять пути, я также пытался включить файл в проект при публикации и даже переназначал путь к файлу, и, похоже, его не волнует, где находится файл, он не открывается. Я проверил, библиотеки SQLite есть. Я также пробовал работать от имени администратора. ^
Я в растерянности, поскольку впервые приложение не работает одинаково от среды Visual Studio до установки. Любая помощь в этом будет полезна.
Код: Выделить всё
string dbpath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "TestDBLite.db");
SQLiteConnection db;
db = new SQLiteConnection($"Data Source={dbpath}");
db.Open();
Код: Выделить всё
See the end of this message for details on invoking just-in-time
(JIT) debugging instead of this dialog box.
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object. at
ProjectName.DataAccess.CurrentState() at
ProjectName.Form1.ShowCurrentDBState() at
ProjectName.Form1.Form1_Load(Object sender, EventArgs e) at
System.Windows.Forms.Form.OnLoad(EventArgs e) at
System.Windows.Forms.Form.OnCreateControl() at
System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl() at
System.Windows.Forms.Control.WmShowWindow(Message& m) at
System.Windows.Forms.Control.WndProc(Message& m) at
System.Windows.Forms.Form.WmShowWindow(Message& m) at
System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the jitDebugging
value set in the system.windows.forms section. The application must
also be compiled with debugging enabled.
For example:
When JIT debugging is enabled, any unhandled exception will be sent to
the JIT debugger registered on the computer rather than be handled by
this dialog box.
Подробнее здесь: https://stackoverflow.com/questions/797 ... -publish-a
Мобильная версия