System.MissingMethodException when using `new DiscoveryClient(uri)`
See original GitHub issueWhen executing this
[HttpGet]
public async Task<IHttpActionResult> GetOpenId(string code, string state) {
var discoveryClient = new DiscoveryClient(issuerUri);
// rest omitted for brevity, it breaks here
}
I get
Method not found: 'Void IdentityModel.Client.DiscoveryClient..ctor(System.String, System.Net.Http.HttpMessageHandler)'.
Response from a Web Api 2 action:
<Error><Message>An error has occurred.</Message><ExceptionMessage>Method not found: 'Void IdentityModel.Client.DiscoveryClient..ctor(System.String, System.Net.Http.HttpMessageHandler)'.</ExceptionMessage><ExceptionType>System.MissingMethodException</ExceptionType><StackTrace> at Admin.OpenIdController.<GetOpenId>d__0.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
at Admin.OpenIdController.GetOpenId(String code, String state)
at lambda_method(Closure , Object , Object[] )
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass12.<GetExecutor>b__8(Object instance, Object[] methodParameters)
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()</StackTrace></Error>
Issue Analytics
- State:
- Created 7 years ago
- Comments:26 (10 by maintainers)
Top Results From Across the Web
Unable to find DiscoveryClient for IdentityServer4
Installed IdentityModel nuget package in .Net 7.5 MVC application. But unable to find the DiscoveryClient . var discoveryClient = new ...
Read more >IdentityServer4 and MongoDB #4523 - Support - ASP.NET Zero
MissingMethodException : Method not found: 'System.ValueTuple`2<System.String,System.String> IdentityModel.Client.DiscoveryClient.
Read more >Method not found: System.MissingMethodException
I am upgrading .net core web api 2.2 to .net core 3.1 while runtime i am getting error like , 'Microsoft.Extensions.DependencyInjection.
Read more >Reference | Steeltoe
Reference. This section explores the interfaces and classes that are the essential components for developing applications with Steeltoe RabbitMQ.
Read more >1. Service Discovery: Eureka Clients
When a client registers with Eureka, it provides meta-data about itself — such as host, port, health indicator URL, home page, and other...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Tbh. I am sick of figuring out which part of the .net tooling is now broken again.
I am facing the same issue.
I have a project
IdentityServer4.Management
which has references toIdentityServer4.EntityFramework 1.0.1
andIdentityServer4.AccessTokenValidation 1.2.1
.In the Startup.cs I have:
Standalone, that project works fine. However, I have an integration tests project which has a reference to
IdentityServer4.Management
project. When I try to create a TestServer in the following way:I receive the following error message in the output of my test:
Not entirely sure what I am doing wrong.