reactiveui / refit

The automatic type-safe REST library for .NET Core, Xamarin and .NET. Heavily inspired by Square's Retrofit library, Refit turns your REST API into a live interface.
https://reactiveui.github.io/refit/
MIT License
8.47k stars 745 forks source link

Adding Refit Version 6.3.2 to MVC Application causes Error and Renders Application Unusable #1342

Closed QueenBee61 closed 1 day ago

QueenBee61 commented 2 years ago

When I try to add Refit Version 6.3.2 I receive the following error on build:

Packages.config does not support Analyzers, including Source Generators. Migrate to PackageReference: 'https://devblogs.microsoft.com/nuget/migrate-packages-config-to-package-reference/'

It is not usable in MVC Applications? Is there a particular version I must use? I am able to install version 4.0, in the MVC application but then I can't use the SDK created with 6.3.2. I tried to create the SDK using 4.0 and receive the error "ApiResponse" does not exist.

anaisbetts commented 2 years ago

Isn't this telling you what to do?

QueenBee61 commented 2 years ago

It doesn't work. It tells me either the project is not using packages.config or is not eligible, or something on that order.

jakeshoemaker commented 2 years ago

@QueenBee61 there are ways to force VisualStudio to think its eligible. You need to edit the .csproj file and change it to a class library then you can migrate it. I just did it. It was lots of work with a big repo, but doable. This StackOverflow article helped me https://stackoverflow.com/questions/57581514/vs-2015-to-2017-migrate-to-package-reference-failed

Stack Overflow
VS 2015 to 2017 migrate to package reference failed
I've inherited a VS-2015 C# application and would like to migrate it to VS 2017 or 2019. It has a packages.config file with 4 packages: <package id="AjaxControlToolkit" version="...
QueenBee61 commented 2 years ago

@jakeshoemaker - thanks!

jrummell commented 2 years ago

What version of Refit do I need to downgrade to that will support packages.config? I can't afford to migrate a huge MVC project on full framework today.

jonathh21 commented 2 months ago

What version of Refit do I need to downgrade to that will support packages.config? I can't afford to migrate a huge MVC project on full framework today.

I'm here.. same reason thinking the same thing.. looking for the same solution.

Did you find a version?

Thanks

jrummell commented 2 months ago

I'm here.. same reason thinking the same thing.. looking for the same solution.

Did you find a version?

Thanks

@jonathh21 I believe it was 4.7.51

jonathh21 commented 2 months ago

Wow thanks.

Just crept up on 6.0.15 a change to 6.0.21 and the error returns.

However I haven't actually used it yet! So might back to go lower..

jonathh21 commented 2 months ago

Spoke to soon.

Anything 6.* and I get the error

"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."

Changing to 5.2.4 and that error (at least) goes away.

ChrisPulman commented 1 day ago

Closing as a user-based resolution, please update to the latest version, thank you.