You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Revit应用中使用SQLite遭遇FileNotFoundException的原因排查

Troubleshooting SQLite FileNotFoundException in Revit Add-ins

Hey there, let's work through why you're hitting that FileNotFoundException even after referencing SQLite DLLs and placing them in the specified directory—this is a common gotcha with Revit's add-in environment. Here are the most likely culprits:

  • Revit's execution directory takes priority
    Revit doesn't always look in your add-in's output folder for dependencies. It often checks its own installation directory first (e.g., C:\Program Files\Autodesk\Revit 2024). Try copying both the managed System.Data.SQLite.dll and the native SQLite.Interop.dll (critical for mixed-mode assemblies) directly into Revit's install folder. Also, double-check you're using 64-bit DLLs—Revit is 64-bit, so 32-bit SQLite files will fail silently with this error.

  • Copy Local property isn't set correctly
    In your Visual Studio project, right-click the SQLite reference and go to Properties. Make sure Copy Local is set to True. Even if you manually copy DLLs, if this flag is false, your build might not include them in the output when deploying the add-in. For the native interop DLL, ensure it's being copied to a x64 subfolder under your add-in's directory (or directly into Revit's install folder).

  • Add-in deployment location matters
    Revit loads add-ins from specific folders like %APPDATA%\Autodesk\Revit\Addins\20XX. If your add-in is here, the SQLite DLLs need to live in the same folder as your add-in's main DLL. Relative paths can be unreliable in Revit's context, so keeping all dependencies alongside your add-in eliminates path confusion. If you're using an installer, verify it's packaging all required SQLite files (managed and native) to this location.

  • Version mismatches or conflicting DLLs
    Make sure the SQLite DLL version you're referencing matches the one you're placing. If you updated the NuGet package but didn't replace the old DLL in the target folder, a version mismatch will trigger this error. You can also use tools like Process Explorer to check which SQLite DLLs Revit is loading—sometimes another add-in might be loading a different version, causing a conflict.

  • Permission restrictions block access
    If you placed the DLLs in a restricted folder like Program Files without admin rights, Revit might not have read access. Try moving the SQLite files to your add-in's folder in AppData (a non-restricted location) and test again.

内容的提问来源于stack exchange,提问作者uakam

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 06:20:37