Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StackExchange.Redis.StrongName problem in AspNetCore 2.0 #697

Closed
Rodrigo-Andrade opened this issue Aug 20, 2017 · 19 comments
Closed

StackExchange.Redis.StrongName problem in AspNetCore 2.0 #697

Rodrigo-Andrade opened this issue Aug 20, 2017 · 19 comments

Comments

@Rodrigo-Andrade
Copy link

I am porting an app from the full framework to the new dotnetcore 2.0.

I added StackExchange.Redis as a nuget dependency, when i build the solution i get this:

Error CS0433 The type 'IDatabase' 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'

my csproj:

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netcoreapp2.0</TargetFramework>
  </PropertyGroup>

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

  <ItemGroup>
    <PackageReference Include="AWSSDK.S3" Version="3.3.10.1" />
    <PackageReference Include="AWSSDK.SimpleNotificationService" Version="3.3.0.21" />
    <PackageReference Include="Dapper" Version="1.50.2" />
    <PackageReference Include="JetBrains.Annotations" Version="11.0.0" />
    <PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
    <PackageReference Include="MySqlConnector" Version="0.25.1" />
    <PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
    <PackageReference Include="Polly" Version="5.3.1" />
    <PackageReference Include="StackExchange.Redis" Version="1.2.6" />
  </ItemGroup>

  <ItemGroup>
    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" />
  </ItemGroup>

</Project>
@NickCraver
Copy link
Collaborator

Ultimately we're included in the Microsoft.AspNetCore.All package, so you can simply remove this line:

<PackageReference Include="StackExchange.Redis" Version="1.2.6" />

@Rodrigo-Andrade
Copy link
Author

i installed the newer version of the strong named package, but, is it intended to only allow strong named versions for dotnet core? it was quite confusing until i got what was going on.

@NickCraver
Copy link
Collaborator

@Rodrigo-Andrade There are just 2 packages (one strong, one not). We agree it's confusing since we've gotten so populate (dependency tree-wise). In V2 the main package will be strongly named and .StrongName will go away.

@jkellz-dev
Copy link

For others who have run into this issue where .Net Core is still referencing the StrongName package see this issue for the workaround: NuGet/Home#4989

@mgravell
Copy link
Collaborator

mgravell commented Apr 3, 2018 via email

@elestedt
Copy link

When is this going to be resolved? The workaround mentioned does make dotnet build run without errors or warnings - but IDE's, in my case specifically vscode, still shows alot of errors on this...
I'm running with the RC1-final of .NET Core 2.1.

@chris-brown
Copy link

If your using netcore 2.1 @elestedt you should be able to move to the new meta-package Microsoft.AspNetCore.App and reference StackExchange.Redis explicitly as it has been taken out of the .all meta-package. More details here: aspnet/Announcements#287

@elestedt
Copy link

@chris-brown I am on the Microsoft.AspNetCore.All package - which is the default one. But I'll try swapping to Microsoft.AspNetCore.App and see if it makes a difference.

@erdogangulsoy
Copy link

Swapping to Microsoft.AspNetCore.App works! Thanks.

charlesrobichaux added a commit to charlesrobichaux/eShopOnContainers that referenced this issue Jan 13, 2019
Removed the PackageReference to StackExchange.Redis.StrongName as it has been explicitly referenced in the Microsoft.AspNetCore.App package

Fixes build error CS0433 The type 'ConnectionMultiplexer' exists in both 'StackExchange.Redis.StrongName, Version=1.2.6.0, Culture=neutral, PublicKeyToken=c219ff1ca8c2ce46' and 'StackExchange.Redis, Version=2.0.0.0, Culture=neutral, PublicKeyToken=c219ff1ca8c2ce4'

See StackExchange/StackExchange.Redis#697 (comment)
@ReneCode
Copy link

simply install only the nuget-package:
StackExchange.Redis.StrongName

@dewelloper
Copy link

@Rodrigo-Andrade There are just 2 packages (one strong, one not). We agree it's confusing since we've gotten so populate (dependency tree-wise). In V2 the main package will be strongly named and .StrongName will go away.

how to go away?. i have tryed everything

@mcheung610
Copy link

Does anyone has a fix for this? I am trying to upgrade stackexchange.redis in my netcoreapp and keep getting this error.

@uskorc
Copy link

uskorc commented Aug 7, 2019

@mcheung610 Please see this issue 4989 on nuget home

@dewelloper
Copy link

I rembember that edit project file write versions by hand and after it seem to ok

@mesutpiskin
Copy link

Does anyone has a fix for this

@akhileshmaithani
Copy link

akhileshmaithani commented Sep 9, 2020

Does anyone have a solution for this I am getting the same error in .NET Core 3.1?

image

@mgravell
Copy link
Collaborator

mgravell commented Sep 9, 2020

Without knowing your build dependencies, that's hard to comment on, but: from v2, the StrongName package is effectively redundant and obsolete

@akhileshmaithani
Copy link

Without knowing your build dependencies, that's hard to comment on, but: from v2, the StrongName package is effectively redundant and obsolete

image
Please check the screenshot for build dependencies.

@NickCraver
Copy link
Collaborator

Ah I see - they changed the package name after 2.x, see https://www.nuget.org/packages/Microsoft.Extensions.Caching.StackExchangeRedis/3.1.8 instead of Microsoft.Extensions.Caching.Redis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests