Identityserver4: Microsoft.IdentityModel.Tokens problem in beta4

Created on 27 Jun 2016  路  18Comments  路  Source: IdentityServer/IdentityServer4

Hey ,

Just tried out beta4. But getting this error:

Severity    Code    Description Project File    Line    Suppression State
Error   CS1705  Assembly 'IdentityServer4' with identity 'IdentityServer4, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'Microsoft.IdentityModel.Tokens, Version=5.0.0.699, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'Microsoft.IdentityModel.Tokens' with identity 'Microsoft.IdentityModel.Tokens, Version=5.0.0.127, Culture=neutral, PublicKeyToken=31bf3856ad364e35'   twee.cloud.auth..NETCoreApp,Version=v1.0    C:\@Project\twee.cloud\twee.cloud.auth\src\Startup.cs   51  Active

my project.json looks like this:

{
  "dependencies": {
    "Dapper": "1.50.0-rc2b",
    "CryptoHelper": "1.0.0-rc2-final",
    "Swashbuckle": "6.0.0-beta9",
    "IdentityServer4": "1.0.0-beta4",
    "StackExchange.Redis": "1.1.604-alpha",
    "Microsoft.AspNetCore.Diagnostics": "1.0.0",
    "Microsoft.AspNetCore.Mvc": "1.0.0",
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
    "Microsoft.Extensions.Configuration": "1.0.0",
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
    "Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",
    "Microsoft.Extensions.Configuration.Json": "1.0.0",
    "Microsoft.Extensions.Logging": "1.0.0",
    "Microsoft.Extensions.Logging.Console": "1.0.0",
    "Microsoft.Extensions.Logging.Debug": "1.0.0",
    "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
    "Microsoft.NETCore.App": {
      "version": "1.0.0",
      "type": "platform"
    },
    "Npgsql": "3.1.4",
    "System.Linq": "4.1.0"
  },

  "tools": {
  },

  "frameworks": {
    "netcoreapp1.0": {
      "imports": [
        "dotnet5.6"
      ]
    }
  },

  "buildOptions": {
    "emitEntryPoint": true,
    "preserveCompilationContext": true
  },

  "runtimeOptions": {
    "gcServer": true
  },

  "publishOptions": {
    "include": [
      "wwwroot",
      "Views",
      "appsettings.json",
      "web.config"
    ]
  },

  "scripts": {
    "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
  }
}

so not sure why I'm getting that error.

bug

All 18 comments

Noticed it was the same problem in Samples when I opened them. So to reproduces , just open MVC and API.sln and check startup / or try to build:

image

@leastprivilege

Open our MVC and API sample and compare.

let me know

@leastprivilege yes I did and got the same problem :)

C:\@Project\IdentityServer4.Samples\MVC and API\src\IdentityServer\Startup.cs(25,27): error CS1705: Assembly 'IdentityServer4' with identity 'IdentityServer4, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'Microsoft.IdentityModel.Tokens, Version=5.0.0.699, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'Microsoft.IdentityModel.Tokens' with identity 'Microsoft.IdentityModel.Tokens, Version=5.0.0.127, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

The Credential verb changed. But that is trivial. This is less so:

error CS1705: Assembly 'IdentityServer4' with identity 'IdentityServer4, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'Microsoft.IdentityModel.Tokens, Version=5.0.0.699, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'Microsoft.IdentityModel.Tokens' with identity 'Microsoft.IdentityModel.Tokens, Version=5.0.0.127, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

Is it possible that the beta4 package was built against that one "preview versions" nuget server that Microsoft has set up so it either directly or indirectly floats a Microsoft.IdentityModel.Tokens that is newer than the newly released 5.0.0 version?

having a look

https://www.nuget.org/packages/System.IdentityModel.Tokens.Jwt/

not sure where you have that nuget from - it is def not from us.

Maybe delete your .vs folder and nuget cache

Tried that also but no luck. The nuget comes from https://www.nuget.org/packages/System.IdentityModel.Tokens.Jwt/ cause it has an dependency on it.

image

FWIW that error is not a nuget error. It's a dll reference error. So it could be that System.IdentityModel.Tokens.Jwt has a package dependency on the correct package but a dll dependency on the wrong dll... If System.IdentityMode.Tokens.Jwt was in fact the package built (as in compiled) using a nuget repo other than the public one we all use... or just a local cache that _used to_.

... that said - deleting package cache does no good

As a workaround, we just commented out setting up the certificate for now as we haven't gotten far enough along down the IdentityServer4 path for it to matter yet. Hopefully things will be worked out in the next few days.

I'm getting the same thing. I just installed 2015 Fresh w/ Update 3 & The 1.0.0 Preview 2 SDK. I created an empty Core WebApp and when I started to pull from the example...got the same error.

Same problem here.

same issue here

Got the same problem as well. This looks like a bug.

OK - after deleting my package cache I can repro the problem.

Not sure yet what the problem is. working on it.

I published beta4-update1 - give it a try

It works, thanks!

thanks

What a quick fix! Thanks.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

osmankibar picture osmankibar  路  3Comments

leksim picture leksim  路  3Comments

leastprivilege picture leastprivilege  路  3Comments

klioqc picture klioqc  路  3Comments

krgm03 picture krgm03  路  3Comments