RicoSuter / NSwag

The Swagger/OpenAPI toolchain for .NET, ASP.NET Core and TypeScript.
http://NSwag.org
MIT License
6.79k stars 1.29k forks source link

System.String Error #4545

Open baabak1990 opened 1 year ago

baabak1990 commented 1 year ago

I used Nswag studio and I generated related codes to my Api . I used Asp .Net 6 MVC as place to add the out put of nswage studio codes. in program.cs file I registered the DI with this code :

builder.Services.AddHttpClient<IClient, Client>(cl => cl.BaseAddress = new Uri("https://localhost:7181"));

However ,when I used this Iclient interface in my controllers or outher class I faced with this error (I used them by constructor injection) : InvalidOperationException: Unable to resolve service for type 'System.String' while attempting to activate 'GymManagement.UI.Asp.NetMVC.Services.Base.Client'.

dafeng commented 2 weeks ago

same issue