如何将asp.net-mvc中的StackExchange.Redis.IDatabase集成到两个DLL中而不重复?

2026-03-30 12:141阅读0评论SEO问题
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计179个文字,预计阅读时间需要1分钟。

如何将asp.net-mvc中的StackExchange.Redis.IDatabase集成到两个DLL中而不重复?

安装了Redis、StackExchange.Redis和nuget,工作正常。后来安装了RedisSessionStateProvider nuget,它依赖于StackExchange.Redis.StrongName。现在收到以下错误:Error 107,类型StackExchange.Redis.IDatabase不存在。

如何将asp.net-mvc中的StackExchange.Redis.IDatabase集成到两个DLL中而不重复?

我安装了Redis StackExchange nuget,工作正常.但后来我安装了RedisSessionStateProvider nuget,它安装了StackExchange.Redis.StrongName.

现在我收到以下错误,

Error 107 The type ‘StackExchange.Redis.IDatabase‘ exists in both
‘e:\Source\packages\StackExchange.Redis.1.0.481\lib\net45\StackExchange.Redis.dll’
and
‘e:\Source\packages\StackExchange.Redis.StrongName.1.0.481\lib\net45\StackExchange.Redis.StrongName.dll’ E:\Source\MyApp\Helpers\RedisHelper\StackExchangeRedisExtensions.cs 13 37 MyApp

为什么是这样?

一些方法/属性/接口在上面的两个dll中重复.

删除StackExchange.Redis引用以解决错误.

本文共计179个文字,预计阅读时间需要1分钟。

如何将asp.net-mvc中的StackExchange.Redis.IDatabase集成到两个DLL中而不重复?

安装了Redis、StackExchange.Redis和nuget,工作正常。后来安装了RedisSessionStateProvider nuget,它依赖于StackExchange.Redis.StrongName。现在收到以下错误:Error 107,类型StackExchange.Redis.IDatabase不存在。

如何将asp.net-mvc中的StackExchange.Redis.IDatabase集成到两个DLL中而不重复?

我安装了Redis StackExchange nuget,工作正常.但后来我安装了RedisSessionStateProvider nuget,它安装了StackExchange.Redis.StrongName.

现在我收到以下错误,

Error 107 The type ‘StackExchange.Redis.IDatabase‘ exists in both
‘e:\Source\packages\StackExchange.Redis.1.0.481\lib\net45\StackExchange.Redis.dll’
and
‘e:\Source\packages\StackExchange.Redis.StrongName.1.0.481\lib\net45\StackExchange.Redis.StrongName.dll’ E:\Source\MyApp\Helpers\RedisHelper\StackExchangeRedisExtensions.cs 13 37 MyApp

为什么是这样?

一些方法/属性/接口在上面的两个dll中重复.

删除StackExchange.Redis引用以解决错误.