[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 issueDescribe 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:
- Created 3 years ago
- Comments:14 (3 by maintainers)
Top Related StackOverflow Question
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)
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.