autorest: Method not found: 'Void Microsoft.Rest.ServiceClient`1..ctor(System.Net.Http.DelegatingHandler[])'.

Hi,

I’m developing a WPF application that uses an autorest generated client to communicate with an API. It was working correctly until today (VS2017)

I’m getting the following error: Method not found: ‘Void Microsoft.Rest.ServiceClient`1…ctor(System.Net.Http.DelegatingHandler[])’.

I tried the following:

  • Rebuild and Clean the Project
  • Run autorest --reset and regenerate the client
  • Restart visual studio
  • Update to the lastest version of Microsoft.Rest.ClientRuntime (2.3.10)
  • Search in my hard drive and erase all old versios of ClientRuntime

None of them worked, I’m just calling the constructor like this (ProjectAPI is the name of my API generated class): ProjectAPI api = new ProjectAPI (new Uri("http://localhost"));

I searched in the repository but there are no issues related to this, anyone can help?

Thanks a lot.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 3
  • Comments: 20 (6 by maintainers)

Most upvoted comments

@angeldinev – yeah, sorry about that. There is a missing .ConfigureAwait(false) in .13 that is fixed in .14

hmm, sounds like I need to go fix all my client packages to depend on 2.3.12 instead 😕

The magic sauce to remove the error mentioned in this issue would be the following assemblyBinding added to app.config or web.config: <dependentAssembly><assemblyIdentity name="System.Net.Http" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" /><bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" /> </dependentAssembly>

I think System.Net.Http versioning has been a pain for both Microsoft and developers since it was shipped out of band.

Off the top of my head, what .NET framework version? (the Microsoft.Rest.ClientRuntime may only have certain profiles?)

does it build from the cmdline?

I’ve heard recent issues with VS2017 and some weird package-ref problems…