question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SQLite.Ms wants to use System.Data.Sqlite in Release mode

See original GitHub issue

I use linq2db and linq2db.SQLite.MS. Compiling to Debug mode does not produce any Error. But on doing this in Release mode, the first time it tries to create a DataConnection it shuts down with the Error below.

Exception message: 
System.InvalidOperationException
  HResult=0x80131509
  Nachricht = Cannot load assembly System.Data.SQLite
  Quelle = <Die Ausnahmequelle kann nicht ausgewertet werden.>
  Stapelüberwachung:
<Die Ausnahmestapelüberwachung kann nicht ausgewertet werden.>

Stack trace:
   at LinqToDB.DataProvider.SQLite.SQLiteProviderAdapter.CreateAdapter(String assemblyName, String clientNamespace, String prefix) in D:\a\1\s\Source\LinqToDB\DataProvider\SQLite\SQLiteProviderAdapter.cs:line 52
   at LinqToDB.DataProvider.SQLite.SQLiteProviderAdapter.GetInstance(String name) in D:\a\1\s\Source\LinqToDB\DataProvider\SQLite\SQLiteProviderAdapter.cs:line 78
   at LinqToDB.DataProvider.SQLite.SQLiteDataProvider..ctor(String name, MappingSchema mappingSchema) in D:\a\1\s\Source\LinqToDB\DataProvider\SQLite\SQLiteDataProvider.cs:line 32
   at LinqToDB.DataProvider.SQLite.SQLiteDataProvider..ctor(String name) in D:\a\1\s\Source\LinqToDB\DataProvider\SQLite\SQLiteDataProvider.cs:line 27
   at LinqToDB.DataProvider.SQLite.SQLiteTools.<>c.<.cctor>b__21_0() in D:\a\1\s\Source\LinqToDB\DataProvider\SQLite\SQLiteTools.cs:line 17
   at System.Func`1.Invoke()
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\shared\System\Lazy.cs:line 324

Steps to reproduce

I use the code below to build my LinqToDbConnectionOptions. Nothing else has been used.

LinqToDB.Common.Configuration.Linq.AllowMultipleQuery = true;
            var connectionString = @"Data Source=internal.db";

            // create options builder
            var builder = new LinqToDbConnectionOptionsBuilder();

            // configure connection string
            builder.UseSQLite(connectionString);

            return builder.Build();

Environment details

linq2db version: 3.1.6 Database Server: ? Database Provider: SQlite MS Operating system: Windows .NET Framework: .Net Standard 2.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
MaceWinducommented, Feb 6, 2021

That’s sucks. I will try to get rid of this method, but I have no idea how to ensure that we don’t have other APIs, missing from UWP as analyzer tool lies…

0reactions
MaceWinducommented, Feb 7, 2021

BTW, exception generated only from corert runtime (Compile with .NET Native tool chain option enabled for project).

Read more comments on GitHub >

github_iconTop Results From Across the Web

System.Data.SQLite Close() not releasing database file
It does not show my program releasing the db file after the close(). Visual Studio 2010, C#, System.Data.SQLite version 1.0.77.0, Win7. I saw...
Read more >
Custom SQLite versions - Microsoft.Data.Sqlite
Learn how to use a custom version of the native SQLite library.
Read more >
.NET Core: Introduction To Microsoft.Data.Sqlite
NET Core is evolving. It's still in pre-release mode. Especially when it comes to “Microsoft.Data.Sqlite,” it supports basic functionalities for ...
Read more >
Downloads Page
For detailed information about the latest downloads for each Microsoft Visual C++ Runtime Library release, please refer to the following page:.
Read more >
How do I add sqlite in the visual studio 2022 data source ...
Short answer, and what I see as the end of the discussion ... SQLite is not a Microsoft product.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found