使用 SNAP 的 Fasterflect 的正确版本是哪个?
当将 autofac 与 snap 一起使用时,我遇到以下异常:
测试方法 Halcyon.Mall.Logging.LogCallTests.FooLogCallInterceptor_ShouldBeCalled 抛出异常: Autofac.Core.DependencyResolutionException:执行解析操作时引发异常。有关详细信息,请参阅内部异常。 ---> System.IO.FileLoadException:无法加载文件或程序集“Fasterflect,Version=2.0.1.0,Culture=neutral,PublicKeyToken=a64e1179c81b1e25”或其依赖项之一。找到的程序集的清单定义与程序集引用不匹配。 (HRESULT 异常:0x80131040)
autofac (2.5.2.830) 手动安装为 nuget 包。 Fasterflect (2.0.4429.39723) 作为 SNAP (1.7.3) 的依赖包自动安装
When using autofac with snap, I encounter the following exception:
Test method Halcyon.Mall.Logging.LogCallTests.FooLogCallInterceptor_ShouldBeCalled threw exception:
Autofac.Core.DependencyResolutionException: An exception was thrown while executing a resolve operation. See the InnerException for details. ---> System.IO.FileLoadException: Could not load file or assembly 'Fasterflect, Version=2.0.1.0, Culture=neutral, PublicKeyToken=a64e1179c81b1e25' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
The autofac (2.5.2.830) is installed as a nuget package manually.
The fasterflect (2.0.4429.39723) is installed automatically as a dependent package of SNAP (1.7.3)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我今天在使用 Snap 1.7.7(最新版本)时遇到了同样的问题。 Snap.StructureMap 似乎需要 Fasterflect 2.0,但 Snap 1.7.7 的 NuGet 会检索最新的 Fasterflect,即 2.1。我能够通过在单独的项目中使用 NuGet 下载 Fasterflect 2.0.2 (
PM> Install-Package Fasterflect -version 2.0.2
) 来解决这个问题,然后从我的主项目中删除对 Fasterflect 的现有引用,然后浏览并添加对旧版 Fasterflect 2.0.2 DLL 的基于文件的引用。I had the same problem today with Snap 1.7.7 -- the latest version. Snap.StructureMap appears to require Fasterflect 2.0 but a NuGet of Snap 1.7.7 retrieves the latest Fasterflect, which is 2.1. I was able to solve it by downloading Fasterflect 2.0.2 using NuGet in a separate project (
PM> Install-Package Fasterflect -version 2.0.2
), then deleting the existing reference to Fasterflect from my main project, then browsing to and adding a file-based reference to the older Fasterflect 2.0.2 DLL.