-
-
Notifications
You must be signed in to change notification settings - Fork 748
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] 5.0.23 to 5.1.54 update causes build errors (missing using directives in stub) #892
Comments
I assume it is caused by this PR: #803 |
Ah, yeah that seems very likely, thanks @Dreamescaper! |
There is already one bug related to usings fixed: #876 But you mentioned that it reproduces with latest build as well, so I assume it's something else. |
Yeah, I've identified the first crashing build to be |
@Dreamescaper I've found the issue, looks like it's caused by an incorrect handling of Here's a repro. Note: this only breaks if the classes are defined in different files. namespace Rest.Models
{
public sealed class User { }
}
namespace Rest.Services
{
public interface IA
{
[Get("/users/{id}.json")]
Task<User> GetUserAsync(string id);
}
}
namespace Rest.Services
{
public interface IB : IA
{
[Post("/api/foo/{id}.json")]
Task<string> FooAsync(string id);
}
} This also seems to depend quite a bit on the exact file configuration. For instance, defining all these models/services in the same file causes no issues. Also, interestingly enough, if each model is fully qualified (even when the actual fully qualified name isn't necessary, as the file already contains the right Hope this helps! |
Makes sense. Should be easy to fix, I'll take a look. |
Awesome, thank you for your help! 😊 |
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. |
Describe the bug
Upgrading from
5.0.23
to5.1.54
causes a build error due to someusing
directives not being added to the generated stubs. I have multiple libraries usingrefit
and only one of them seems to break with this upgrade, I'll do some digging to see if I can figure out the cause or create a repro.As a test, I've added the various
using
directives manually to the stubs, and that let me successfully build and run my app. Of course, cleaning the solution and rebuilding made those errors pop right back up again. Downgrading to5.0.23
fixed the issue for the time being.EDIT: the library fails to build with
5.1.27
as well. Will try prerelease builds next.EDIT 2: some more info:
5.1.60
build, same errorsRefit
feed. The first build causing the errors is actually just5.0.39
. Up to5.0.32
builds just fine.cc. @clairernovotny is there somewhere to look up the exact list of commits between releases on the NuGet feed so that I can try seeing if I can spot the change that caused this to break? 😄
I've tried searching for them on the Azure Pipeline but I can't see packages before
5.0.59
there.Steps To Reproduce
Not available yet, I'll first try all the intermediate versions from
5.0.23
to5.1.54
to see if I can spot the first that's causing this crash to occur. Once I have that, I'll see if I can create a repro.Expected behavior
Libraries using
refit
should build correctly.Screenshots
Environment
5.1.54
5.0.23
Additional context
I'm trying to build a .NET Standard 2.0 library.
The text was updated successfully, but these errors were encountered: