Search code examples
asp.net-coreopeniddict

.NET Core + Openiddict InvalidCastException


I'm using openiddict on a .net core 1.1 project. So far i was able to login through /connect/token endpoint.

Suddenly, without any changes to the controller i get the following exception

InvalidCastException: Unable to cast object of type 'AspNet.Security.OpenIdConnect.Primitives.OpenIdConnectRequest' to type 'OpenIddict.OpenIddictOptions'.

Is there anyone else having the same issue?


Solution

  • API changes have been introduced in ASOS 2.0.0-rc1-final that are incompatible with the exact OpenIddict version you're using. To fix that, remove the packages that start with AspNet.Security.OpenIdConnect from your .nuget\packages folder and restore your project when it's done.