拒绝访问调试引用IIS中运行的Sqlite的ASP.NET Core应用程序

时间:2019-04-02 10:08:02

标签: sqlite entity-framework-core sqlite-net

ASP.NET Core 2.2项目引用Microsoft.EntityFrameworkCore.Sqlite (2.2.3)作为PackageReference。

由于提升了用户流程,因此在IIS Express中调试应用程序工作正常。

问题::在IIS中调试应用会出现错误Unable to load DLL 'e_sqlite3' or one of its dependencies: Access is denied

如何在不费力的发布步骤的情况下在IIS中调试应用程序?


到目前为止,我的analisys

找到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权限似乎是罪魁祸首。

如果我给Users组或ApplicationPoolIdentityRead & Execute也行。

为什么全局NuGet软件包文件夹缺少Read & Execute? 这仅仅是非托管代码dll的问题吗?

堆栈跟踪

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)

0 个答案:

没有答案