Dreamescaper / GenerateAspNetCoreClient

DotNet tool to generate HTTP client classes from ASP.NET Core api controllers.
MIT License
63 stars 5 forks source link

.net 8 #20

Closed pmccowat closed 9 months ago

pmccowat commented 9 months ago

I've updated the .net references to .net 8. All tests ran but I had an issue running on my own project, however this might just be my end.

The error I was getting wasCould not load file or assembly 'System.Private.ServiceModel, when registering Mediatr with services.AddMediatR(cfg => cfg.RegisterServicesFromAssemblies(AppDomain.CurrentDomain.GetAssemblies()));

valentasm1 commented 9 months ago

Does it work after updating to .net 8?

pmccowat commented 9 months ago

It worked except I had to make a change in my own project I ran it against to generate APIs.

Not sure if it's because I still have legacy EF6 in the project with EF core but I had to downgrade MediatR to v11 and and MediatR.Extensions.Microsoft.DependencyInjection back in as the build failed looking for System.Service.Model in Startup services.AddMediatR(Assembly.GetExecutingAssembly());

valentasm1 commented 9 months ago

I will try clone and create locally too then. My projects are all in .net8. This tool is great. I dont want move to vs extension. Seem a bit to much, but thats plan B for me. https://marketplace.visualstudio.com/items?itemName=ChristianResmaHelle.ApiClientCodeGenerator2022

I will update with my results

Dreamescaper commented 9 months ago

Sorry for the delay, I'll take a look a bit later. Thanks for the PR!

Dreamescaper commented 9 months ago

Thanks a lot for a PR, merged.

I wasn't able to reproduce that System.Private.ServiceModel, but that's a huge pain here. The approach with CustomLoadContext is very brittle, not sure if there's a better approach. Would be great if you'd be able to share a repro sample.

pmccowat commented 9 months ago

Thanks @Dreamescaper and also thanks for creating this project - I find yours so much better than all the other client generators.

Will try and create a sample soon.