StackExchange.Redis.StrongName已刷新,但未包含在包中 [英] StackExchange.Redis.StrongName is refrenced but not included as package

查看:349
本文介绍了StackExchange.Redis.StrongName已刷新,但未包含在包中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用StackExchange.Redis和.Net Core 2.0启动一个新项目. 但是我遇到了冲突:

I'm starting a new project using StackExchange.Redis and .Net Core 2.0. But I get a conflict:

类型'ConnectionMultiplexer'同时存在于'StackStack.Redis.StrongName,Version = 1.2.4.0,Culture = neutral,PublicKeyToken = c219ff1ca8c2ce46'和'StackExchange.Redis,Version = 1.2.6.0,Culture = neutral,PublicKeyToken =空"

The type 'ConnectionMultiplexer' exists in both 'StackExchange.Redis.StrongName, Version=1.2.4.0, Culture=neutral, PublicKeyToken=c219ff1ca8c2ce46' and 'StackExchange.Redis, Version=1.2.6.0, Culture=neutral, PublicKeyToken=null'

为什么即使我没有引用StackExchange.Redis.StrongName也不是相同的程序集版本,这也为什么显示?

Why is this showing even thou I'm not referencing StackExchange.Redis.StrongName and it's not even the same assembly version?

推荐答案

我在"StackExchange.Redis"程序包中添加了条件标志,以使其起作用.我在两台机器上的两个新项目上试用了该解决方案.别问我为什么行得通.

I added a conditional flag to the "StackExchange.Redis" package, that makes it work. I Tried this solution on two new projects on two machines. Don't ask me why it works tho.

    <Project Sdk="Microsoft.NET.Sdk.Web">
      <PropertyGroup>
        <TargetFramework>netcoreapp2.0</TargetFramework>
      </PropertyGroup>

      <ItemGroup>
        <Folder Include="wwwroot\" />
      </ItemGroup>

      <ItemGroup>
        <PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
      </ItemGroup> 
      <ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
        <PackageReference Include="StackExchange.Redis" Version="1.2.6" />
      </ItemGroup>

    </Project>

这篇关于StackExchange.Redis.StrongName已刷新,但未包含在包中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆