2

The ASP.NET Core 2.2 project references Microsoft.EntityFrameworkCore.Sqlite (2.2.3) as a PackageReference.

Debugging the app in IIS Express works fine, because of the elevated user process.

Problem: Debugging the app in IIS throws an error

Unable to load DLL 'e_sqlite3' or one of its dependencies: Access is denied

How can I debug the app in IIS without laborious publishing steps?

My analysis so far: while e_sqlite3.dll is found and loaded successfully in the folder %userprofile%\.nuget\packages\sqlitepclraw.lib.e_sqlite3.v110_xp\1.1.12\runtimes\win-x64\native\e_sqlite3.dll it has only Read but no Read & Execute permission set.

The missing Execute permissions seems to be the culprit.

It works if I give Users group or ApplicationPoolIdentity also Read & Execute.

Why is the global NuGet packages folder missing Read & Execute? Is this only a problem of the unmanaged code dll's?

Stack Trace

System.DllNotFoundException: Unable to load DLL 'e_sqlite3' or one of its dependencies: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

at SQLitePCL.SQLite3Provider_e_sqlite3.NativeMethods.sqlite3_libversion_number()
at SQLitePCL.SQLite3Provider_e_sqlite3.SQLitePCL.ISQLite3Provider.sqlite3_libversion_number()
at SQLitePCL.raw.SetProvider(ISQLite3Provider imp)

2
  • From stackoverflow.com/questions/52397501/…: .NET Core and .NETSTANDARD don't copy dependencies to output directory, they are mapped using deps.json which points to relative paths from local NuGet cache. Commented Apr 2, 2019 at 14:04
  • I tryed adding <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> to the csproj but the runtimes folder wont be copied Commented Apr 2, 2019 at 14:05

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.