Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Microsoft.IdentityModel.Tokens problem in beta4 #141

Closed
Tazer opened this issue Jun 27, 2016 · 18 comments
Closed

Microsoft.IdentityModel.Tokens problem in beta4 #141

Tazer opened this issue Jun 27, 2016 · 18 comments
Assignees
Labels

Comments

@Tazer
Copy link

Tazer commented Jun 27, 2016

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.

@Tazer
Copy link
Author

Tazer commented Jun 27, 2016

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

@leastprivilege
Copy link
Member

Open our MVC and API sample and compare.

let me know

@Tazer
Copy link
Author

Tazer commented Jun 27, 2016

@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'

@kmaragon
Copy link

kmaragon commented Jun 27, 2016

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?

@leastprivilege
Copy link
Member

having a look

@leastprivilege
Copy link
Member

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

@Tazer
Copy link
Author

Tazer commented Jun 27, 2016

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

@kmaragon
Copy link

kmaragon commented Jun 27, 2016

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.

@MasterSkwerl
Copy link

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.

@ejfn
Copy link

ejfn commented Jun 28, 2016

Same problem here.

@etrafiee
Copy link

etrafiee commented Jun 28, 2016

same issue here

@avoxm
Copy link

avoxm commented Jun 28, 2016

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

@leastprivilege
Copy link
Member

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

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

@leastprivilege
Copy link
Member

I published beta4-update1 - give it a try

@chrisvfabio
Copy link

It works, thanks!

@leastprivilege leastprivilege self-assigned this Jun 28, 2016
@etrafiee
Copy link

etrafiee commented Jun 28, 2016

thanks

@ejfn
Copy link

ejfn commented Jun 28, 2016

What a quick fix! Thanks.

@lock
Copy link

lock bot commented Jan 15, 2020

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.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

8 participants