我的一个项目使用 Elmah,它引用了 SQLite。 Elmah 是针对 SQLite for .Net 版本 1.0.44.0 构建的,
我正在尝试一些 64 位的东西(我的开发盒是 32 位),所以我需要 64 位版本的 SQLite for .Net。 我获取了它的最新版本(当时为 1.0.51.0)并使用他们的安装程序来安装它。
对于我的 32 位项目,我更新了对 System.Data.SQLite 的引用以指向较新的版本。
一旦我意识到我的错误,我就卸载了它并获取了适当的原始版本,并将我的引用指向 1.0.44.0
现在,当我构建时,我收到有关同一依赖程序集的不同版本的警告。 单击它会询问我是否希望它编辑我的 app.config,它会插入以下内容:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Data.SQLite" publicKeyToken="DB937BC2D44FF139" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-1.0.51.0" newVersion="1.0.51.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
嗯..我系统上的任何位置都不再安装或存在 1.0.51.0! 冲突在哪里? 为什么视觉工作室认为它存在于某个地方? 我检查了 GAC,发现任何地方都没有 System.Data.SQLite。
我想摆脱这个烦人的警告。
我在同一解决方案中还有另一个项目也引用了 SQLite,但我从未将引用更新为新版本(并且随后从未将引用更改回来)..它始终引用 1.0.44.0。 该项目根本没有抱怨......
One of my projects uses Elmah, which references SQLite. Elmah is built against SQLite for .Net version 1.0.44.0
well I was experimenting with some 64 bit stuff (my dev box is 32 bit) so I needed the 64 bit version of SQLite for .Net. I grabbed the latest build of it (1.0.51.0 at the time) and used their installer to install it.
For my 32 bit project, I updated the reference to System.Data.SQLite to point to the newer version.
Once I realized my mistake, I uninstalled it and grabbed the appropriate original version, and pointed my reference back to 1.0.44.0
Now when I build I get the warning about different versions of the same dependant assembly. Clicking on it asks if I want it to edit my app.config and it inserts this:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Data.SQLite" publicKeyToken="DB937BC2D44FF139" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-1.0.51.0" newVersion="1.0.51.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
umm..I don't have 1.0.51.0 installed or existing anywhere on my system anymore! where is the conflict? why does visual studio think it exists somewhere? I checked in the GAC and there is no System.Data.SQLite anywhere.
I'd like to get rid of this annoying warning.
I have another project in the same solution that also references SQLite, but I never updated the reference to the newer version (and subsequently never changed the reference back)..it has always been referencing 1.0.44.0. That project doesn't complain at all...
发布评论
评论(2)
使用 ildasm.exe 查看应用程序和程序集中的清单。
Use ildasm.exe to look at the manifests in your app and assemblies.
这是一个实用程序,可帮助识别有问题的引用:
http://www.brianlow.com/index.php/2010/01/25/find-conflicting- assembly-references/
Here is a utility to help identify the offending reference(s):
http://www.brianlow.com/index.php/2010/01/25/find-conflicting-assembly-references/