Unwanted SQLite inserted in \\bin

北慕城南 提交于 2019-12-03 12:00:12

If you are not using SQLite then you need to simply remove it from the source location from where you imported the reference. To expand on that, let's assume you downloaded and unzipped ELMAH to the path C:\ELMAH on your local drive. When you added a reference to ELMAH, you probably pointed to one of the platform versions under C:\ELMAH\bin, like C:\ELMAH\bin\net-2.0\Release. From C:\ELMAH\bin sub-directories, remove all other unwanted assemblies and files except Elmah.dll, Elmah.pdb and Elmah.xml. Strictly speaking, you don't even need the latter two but they are nonetheless recommended. Once you've done that, you can add a reference to Elmah.dll to your project in Visual Studio and none of the dependencies will get pulled into your application's bin directory. You may have to delete your bin directory and re-build your project to get rid of a stale copy of System.Data.SQLite.dll from a previous reference. ELMAH will continue to work fine without System.Data.SQLite.dll as long as you do not use Elmah.SQLiteErrorLog as your error log store.

As per other suggestions, you should not have to remove references to SQLite from the ELMAH sources and make a private build.

I think Visual Studio will detect that SQLite is required by Elmah and copy it if it finds it. In order to achive the same goal as you I removed all SQLite stuff from the Elmah source code and re-built it. It is quite painless thing to do...

Use a text editor with "find-in-files" support to search all your project files for "sqlite". Something must be referencing it.

I know that is an old question, but I have a similar problem and landed here, so perhaps my answer is still helpful for others.

Simply add this to your project file of your web application in a prefered PropertyGroup-element:

<ExcludeFilesFromDeployment>bin\System.Data.SQLite.dll</ExcludeFilesFromDeployment>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!