You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We encounter an issue indicating "***API 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." when invoking Refit-produced APIs. The functionality is successful in the locally built version, but the error arises in the Azure DevOps build.
The problem persists with Refit versions 6.3.2 and 7.0.0. Interestingly, it works without issues when using Refit version 5.x.x.
I see the similar issues reported and possible culprit was from SonarQube. But we don't use it.
I examined the logs with diagnostic logging enabled but couldn't identify any indications of problems. Can someone provide guidance on resolving this issue?
Refit interface
namespace XXX
{
using System.Collections.Generic;
using System.Threading.Tasks;
using Refit;
public interface IJsonPlaceholderAPI
{
/// <summary>
/// GetPosts
/// </summary>
/// <returns>A <see cref="Task{TResult}"/> representing the result of the asynchronous operation.</returns>
[Get("/posts")]
Task<List<Post>> GetPostsAsync();
}
}
Data contract class
public class Post
{
/// <summary>
/// Gets or sets id
/// </summary>
public int Id { get; set; }
/// <summary>
/// Gets or sets id
/// </summary>
public int UserId { get; set; }
/// <summary>
/// Gets or sets id
/// </summary>
public string Title { get; set; }
/// <summary>
/// Gets or sets id
/// </summary>
public string Body { get; set; }
}
Describe the bug 🐞
We encounter an issue indicating "***API 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." when invoking Refit-produced APIs. The functionality is successful in the locally built version, but the error arises in the Azure DevOps build.
The problem persists with Refit versions 6.3.2 and 7.0.0. Interestingly, it works without issues when using Refit version 5.x.x.
I see the similar issues reported and possible culprit was from SonarQube. But we don't use it.
I examined the logs with diagnostic logging enabled but couldn't identify any indications of problems. Can someone provide guidance on resolving this issue?
Refit interface
Data contract class
Step to reproduce
dotnet.exe build .sln --no-restore --no-incremental --configuration Release -p:platform="x64" -p:SourceRevisionId=... -v:n -flp1:Verbosity=d;LogFile=.log;Encoding=UTF-8 -flp2:logfile=.err;errorsonly -bl:.binlog /p:Features="IOperation,flow-analysis" /p:CodeAnalysisRuleSet="" /p:TreatWarningsAsErrors=false /p:RunCodeAnalysis=false /p:GdnRoslynAnalyzersRunId=
Reproduction repository
https://github.com/reactiveui/refit
Expected behavior
This should happen...
Screenshots 🖼️
In local build, I see that the auto-generated classes in the nuget package.
But, I cannot find the auto-generated classes in the nuget package that was build in Aure DevOps.
IDE
Visual Studio 2022
Operating system
Windows
Version
MSBuild version 17.7.3+8ec440e68 for .NET
Device
No response
Refit Version
6.3.2
Additional information ℹ️
No response
The text was updated successfully, but these errors were encountered: