Thanks Michael. IServiceCollection does not contain a definition for ... IServiceCollection doesn't contain a definition of ... Severity Code Description Project File Line Suppression State Error CS1929 'IServiceCollection' does not contain a definition for 'AddHybridModelBinder' and the best . I decided to write a DI provider which provided and registered dependencies inside of it.Before I This fixes the problem: c# - IServiceCollection does not contain a defintion for ... If the information you provided above are all correct, this should be enough. I decided to write a DI provider which provided and registered dependencies inside of it.Before I Thanks Michael. IServiceCollection doesn't contain a definition of AddSwaggerGen. Swagger doesn't recognize AddSwaggerGen after adding swagger NuGet package i.e Swashbuckle.. IServiceCollection' does not contain a definition for 'AddSwaggerGen' and no accessible extension method 'AddSwaggerGen' accepting a first argument of type 'IServiceCollection' could be found The versions of the dependencies seem to be out of sync. IServiceCollection does not contain a definition for AddBaseAddressHttpClient. 1 answer. Important Some information relates to prerelease product that may be substantially modified before it's released. I upgraded a WASM app to 3.2.-rc1.20223.4 and now the following code no longer compiles.. public static async Task Main(string[] args) { var builder = WebAssemblyHostBuilder.CreateDefault(args); builder.Services.AddBaseAddressHttpClient(); Documentation and Build video show 'AddHttpClient' being used, but this doesn't appear to be defined in in the 'IServiceCollection'. I'm trying to implement a solution to expire tokens due to inactivity based on a set time. Microsoft makes no warranties, express or implied, with respect to the information provided here. Documentation and Build video show 'AddHttpClient' being used, but this doesn't appear to be defined in in the 'IServiceCollection'. I've been registering my dependencies to my IOC container via the program class, but it got messy. Don't forget to dotnet restore and add this using Microsoft.Extensions.DependencyInjection; which you probably all did xD. Indeed IServiceCollection does NOT have Configuration property, but HostBuilderContext does.. ConfigureServices has another overload that expose both parameters. I'm using Laravel Passport (Personal Access Client) to create a token. But when I am trying to configure httpclient in my startup.cs I am getting this error: "IServiceCollection does not contain a defintion for AddHttpClient". The versions of the dependencies seem to be out of sync. Use Nuget to update all your packages to be the same version and that should solve the issue. If the information you provided above are all correct, this should be enough. I have already referenced using Microsoft.AspNetCore.Http; and using Microsoft.Extensions.DependencyInjection; and here is what I am trying to do: It's working fine in other project with . Issue Description. I could execute a program from within my program, append as many bytes as I want to my running program and I would know exactly where those bytes were from within my running program and be able to access them easily by reading in the assembly backwards. I've done lots of google search in this regard but nothing and even the Laravel Passport documentation doesn't mention this. Try creating a separate new project and see if it works Use Nuget to update all your packages to be the same version and that should solve the issue. answered 2021-11-15 08:33 Luke Vo. I have already referenced using Microsoft.AspNetCore.Http; and using Microsoft.Extensions.DependencyInjection; and here is what I am trying to do: It's working fine in other project with . answered 2021-11-15 08:33 Luke Vo. My question is, can Laravel passport handle expiration of tokens due to inactivity?. Try creating a separate new project and see if it works Looks like somehow IntelliSense was confused by the other overload. But when I am trying to configure httpclient in my startup.cs I am getting this error: "IServiceCollection does not contain a defintion for AddHttpClient". Indeed IServiceCollection does NOT have Configuration property, but HostBuilderContext does.. ConfigureServices has another overload that expose both parameters. This fixes the problem: Looks like somehow IntelliSense was confused by the other overload. 1 answer. I've been registering my dependencies to my IOC container via the program class, but it got messy. Don't forget to dotnet restore and add this using Microsoft.Extensions.DependencyInjection; which you probably all did xD. I know once an .NET .EXE is running you can insert bytes onto the end of the executable and it doesn't affect anything during runtime.