[BUG] "IMyInterface doesn't look like a Refit interface"after upgrade from 4.6.58 to 4.8.14 (or 5.1.67)

See original GitHub issue

Describe the bug

I have a very simple interface with one method that worked just fine in version 4.6.58. After I did upgrade to 4.8.14 (tried with latest 5.1.67 as well) and clean rebuild with no cached packages I get this error:

IOAuthClient doesn’t look like a Refit interface. Make sure it has at least one method with a Refit HTTP method attribute and Refit is installed in the project.

Steps To Reproduce

This is my interface:

using System.Threading.Tasks;
using Refit;

public interface IOAuthClient
{
    [Post("/oauth/token")]
    Task<TokenResponse> GetToken([Body] TokenRequest request);
}

and register it like this:

RestService.For<IOAuthClient>(oauthHttpClient) // Error happens at this line

Expected behavior

No errors in the newest version of the library.

Screenshots

Environment

  • OS: Windows
  • Device: Desktop
  • Version: 10
  • Working Version: 10

Additional context

I use .Net Framework 4.7.2 in my Project. I have another .net core project that uses a newer version of the library and there are no troubles there. Perhaps it’s framework version related

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jakeshoemakercommented, Jun 1, 2022

Had the same problem with 5.2.4. Looks like it was caused by conflicting versions.

The issue was solved by updating all references to be the same (6.3.2 in my case)

0reactions
github-actions[bot]commented, Apr 13, 2023

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG] "IMyInterface doesn't look like a Refit interface"after ...
I have a very simple interface with one method that worked just fine in version 4.6.58. After I did upgrade to 4.8.14 (tried...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found