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
组或ApplicationPoolIdentity
也Read & 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)