ASP.NET Core 2.2 项目引用Microsoft.EntityFrameworkCore.Sqlite (2.2.3)为PackageReference.
由于提升的用户进程,在 IIS Express 中调试应用程序可以正常工作。
问题:在 IIS 中调试应用程序会引发错误
无法加载 DLL 'e_sqlite3' 或其依赖项之一:访问被拒绝
如何在 IIS 中调试应用程序而无需费力的发布步骤?
到目前为止我的分析:虽然e_sqlite3.dll在文件夹中找到并成功加载,但%userprofile%\.nuget\packages\sqlitepclraw.lib.e_sqlite3.v110_xp\1.1.12\runtimes\win-x64\native\e_sqlite3.dll它只有Read但没有Read & Execute权限集。
缺少Execute权限似乎是罪魁祸首。
如果我给Usersgroup 或者ApplicationPoolIdentity也可以Read & Execute。
为什么全局 NuGet 包文件夹丢失Read & Execute?这只是非托管代码dll的问题吗?
堆栈跟踪
System.DllNotFoundException:无法加载 DLL 'e_sqlite3' 或其依赖项之一:访问被拒绝。(来自 HRESULT 的异常:0x80070005 (E_ACCESSDENIED))
在 SQLitePCL.SQLite3Provider_e_sqlite3.NativeMethods.sqlite3_libversion_number()
在 SQLitePCL.SQLite3Provider_e_sqlite3.SQLitePCL.ISQLite3Provider.sqlite3_libversion_number()
在 SQLitePCL.raw.SetProvider(ISQLite3Provider imp)