You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to use the library w/ the OAuth example project (and valid credentials), appears the OAuthHubSpotAuthenticator is trying to resolve HttpMessageHandler, while it looks like it's mocked in tests, it doesn't appear the inner handler is added to the DI container? I removed the handler from the constructor and it works fine, but I don't exactly know the implications behind that. Maybe someone could point me in the right direction? I am not entirely familiar with the pipeline. Thank you!
Unhandled exception. System.InvalidOperationException: Unable to resolve service for type 'System.Net.Http.HttpMessageHandle r' while attempting to activate 'HubSpot.Authentication.OAuthHubSpotAuthenticator'. at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateArgumentCallSites(Type serviceType, Type implementationType, CallSiteChain callSiteChain, ParameterInfo[] parameters, Boolean throwIfCallSiteNotFound) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateConstructorCallSite(ResultCache lifetime, Type serviceType, Type implementationType, CallSiteChain callSiteChain) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(ServiceDescriptor descriptor, Ty pe serviceType, CallSiteChain callSiteChain, Int32 slot) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(Type serviceType, CallSiteChain callSiteChain) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateCallSite(Type serviceType, CallSiteChain callSiteChain) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.<>c__DisplayClass7_0.<GetCallSite>b__0(Type typ e) at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.GetCallSite(Type serviceType, CallSiteChain cal lSiteChain) at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.CreateServiceAccessor(Type serviceType) at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory) at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType, ServiceProvi derEngineScope serviceProviderEngineScope) at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider , Type serviceType) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provi der) at Microsoft.Extensions.DependencyInjection.HttpClientBuilderExtensions.<>c__41.<AddHttpMessageHandler>b__4_1(HttpMessag eHandlerBuilder b) at Microsoft.Extensions.Http.DefaultHttpClientFactory.<>c__DisplayClass17_0.<CreateHandlerEntry>g__Configure|0(HttpMessag eHandlerBuilder b) at Microsoft.Extensions.Http.LoggingHttpMessageHandlerBuilderFilter.<>c__DisplayClass2_0.<Configure>b__0(HttpMessageHandl erBuilder builder) at Microsoft.Extensions.Http.DefaultHttpClientFactory.CreateHandlerEntry(String name) at Microsoft.Extensions.Http.DefaultHttpClientFactory.<>c__DisplayClass14_0.<.ctor>b__1() at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor) at System.Lazy1.CreateValue() at System.Lazy1.get_Value() at Microsoft.Extensions.Http.DefaultHttpClientFactory.CreateHandler(String name) at Microsoft.Extensions.Http.DefaultHttpClientFactory.CreateClient(String name) at Kralizek.Extensions.Http.HttpRestClient.CreateClient() at Kralizek.Extensions.Http.HttpRestClient.SendAsync[TContent,TResult](HttpMethod method, String path, TContent content, IQueryString query) at HubSpot.HttpHubSpotClient.HubSpot.Model.Companies.IHubSpotCompanyClient.SearchAsync(String domain, IReadOnlyList1 pro perties, Int32 limit, Nullable1 companyOffset) in C:\Users\chris\RiderProjects\hubspot-dotnet-sdk\src\HubSpot.Client\HttpHu bSpotClient.Companies.cs:line 132 at RawOAuth.Program.Main() in C:\Users\chris\RiderProjects\hubspot-dotnet-sdk\samples\hubspot-client\OAuthAuthentication\ Program.cs:line 49 at RawOAuth.Program.<Main>()
The text was updated successfully, but these errors were encountered:
When trying to use the library w/ the OAuth example project (and valid credentials), appears the
OAuthHubSpotAuthenticator
is trying to resolveHttpMessageHandler
, while it looks like it's mocked in tests, it doesn't appear the inner handler is added to the DI container? I removed the handler from the constructor and it works fine, but I don't exactly know the implications behind that. Maybe someone could point me in the right direction? I am not entirely familiar with the pipeline. Thank you!Unhandled exception. System.InvalidOperationException: Unable to resolve service for type 'System.Net.Http.HttpMessageHandle r' while attempting to activate 'HubSpot.Authentication.OAuthHubSpotAuthenticator'. at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateArgumentCallSites(Type serviceType, Type implementationType, CallSiteChain callSiteChain, ParameterInfo[] parameters, Boolean throwIfCallSiteNotFound) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateConstructorCallSite(ResultCache lifetime, Type serviceType, Type implementationType, CallSiteChain callSiteChain) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(ServiceDescriptor descriptor, Ty pe serviceType, CallSiteChain callSiteChain, Int32 slot) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(Type serviceType, CallSiteChain callSiteChain) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateCallSite(Type serviceType, CallSiteChain callSiteChain) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.<>c__DisplayClass7_0.<GetCallSite>b__0(Type typ e) at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.GetCallSite(Type serviceType, CallSiteChain cal lSiteChain) at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.CreateServiceAccessor(Type serviceType) at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory) at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType, ServiceProvi derEngineScope serviceProviderEngineScope) at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider , Type serviceType) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provi der) at Microsoft.Extensions.DependencyInjection.HttpClientBuilderExtensions.<>c__41.<AddHttpMessageHandler>b__4_1(HttpMessag eHandlerBuilder b) at Microsoft.Extensions.Http.DefaultHttpClientFactory.<>c__DisplayClass17_0.<CreateHandlerEntry>g__Configure|0(HttpMessag eHandlerBuilder b) at Microsoft.Extensions.Http.LoggingHttpMessageHandlerBuilderFilter.<>c__DisplayClass2_0.<Configure>b__0(HttpMessageHandl erBuilder builder) at Microsoft.Extensions.Http.DefaultHttpClientFactory.CreateHandlerEntry(String name) at Microsoft.Extensions.Http.DefaultHttpClientFactory.<>c__DisplayClass14_0.<.ctor>b__1() at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor) at System.Lazy1.CreateValue() at System.Lazy1.get_Value() at Microsoft.Extensions.Http.DefaultHttpClientFactory.CreateHandler(String name) at Microsoft.Extensions.Http.DefaultHttpClientFactory.CreateClient(String name) at Kralizek.Extensions.Http.HttpRestClient.CreateClient() at Kralizek.Extensions.Http.HttpRestClient.SendAsync[TContent,TResult](HttpMethod method, String path, TContent content, IQueryString query) at HubSpot.HttpHubSpotClient.HubSpot.Model.Companies.IHubSpotCompanyClient.SearchAsync(String domain, IReadOnlyList1 pro perties, Int32 limit, Nullable1 companyOffset) in C:\Users\chris\RiderProjects\hubspot-dotnet-sdk\src\HubSpot.Client\HttpHu bSpotClient.Companies.cs:line 132 at RawOAuth.Program.Main() in C:\Users\chris\RiderProjects\hubspot-dotnet-sdk\samples\hubspot-client\OAuthAuthentication\ Program.cs:line 49 at RawOAuth.Program.<Main>()
The text was updated successfully, but these errors were encountered: