Skip to content

System.ArgumentNullException: 'Value cannot be null. (Parameter 'input')' when registering the CdsServiceClient on Startup #43

@BoutemineOualid

Description

@BoutemineOualid

Hello everyone,

Trying to figure out why I am getting this error: System.ArgumentNullException: 'Value cannot be null. (Parameter 'input')'.

I noticed that this happens when I am actively debugging the code and then just stop the app, the next time I run my asp.net core project I run into this issue. Each time, I had to change the ssl port I use on IISExpress and sometimes run a disk cleanup.
Wondering if you have and Idea. Here is the service registration sequence:

			serviceCollection
				// CRM CLIENT
				.AddScoped<IOrganizationService, CdsServiceClient>(serviceProvider => new CdsServiceClient(
						serviceProvider.GetService<IConfiguration>()["ConnectionStrings:CRM"]
					)
				);

The connection string is properly formatted and is not null. Bellow is the call stack

 	System.Private.CoreLib.dll!System.Version.Parse(string input)	Unknown
 	System.Private.CoreLib.dll!System.Version.Version(string version)	Unknown
 	Microsoft.PowerPlatform.Cds.Client.dll!Microsoft.PowerPlatform.Cds.Client.CdsConnectionService.ConnectAndInitCdsOrgService(Microsoft.Xrm.Sdk.Discovery.OrganizationDetail orgdata, bool IsOnPrem, System.Uri homeRealmUri)	Unknown
 	Microsoft.PowerPlatform.Cds.Client.dll!Microsoft.PowerPlatform.Cds.Client.CdsConnectionService.DoDirectLogin()	Unknown
 	Microsoft.PowerPlatform.Cds.Client.dll!Microsoft.PowerPlatform.Cds.Client.CdsConnectionService.InitCdsService()	Unknown
 	Microsoft.PowerPlatform.Cds.Client.dll!Microsoft.PowerPlatform.Cds.Client.CdsConnectionService.GetCachedCDSService(out Microsoft.PowerPlatform.Cds.Client.CdsConnectionService ConnectionObject = null)	Unknown
 	Microsoft.PowerPlatform.Cds.Client.dll!Microsoft.PowerPlatform.Cds.Client.CdsConnectionService.IntilizeService(out Microsoft.PowerPlatform.Cds.Client.CdsConnectionService ConnectionObject = null)	Unknown
 	Microsoft.PowerPlatform.Cds.Client.dll!Microsoft.PowerPlatform.Cds.Client.CdsConnectionService.DoLogin(out Microsoft.PowerPlatform.Cds.Client.CdsConnectionService ConnectionObject = null)	Unknown
 	Microsoft.PowerPlatform.Cds.Client.dll!Microsoft.PowerPlatform.Cds.Client.CdsServiceClient.CreateCdsServiceConnection(object externalOrgServiceProxy = null, Microsoft.PowerPlatform.Cds.Client.AuthenticationType requestedAuthType = ClientSecret, string hostName = "", string port = "", string orgName = HIDDEN, System.Net.NetworkCredential credential = null, string userId = "", System.Security.SecureString password = {System.Security.SecureString}, string domain = "", string Geo = "CAN", string claimsHomeRealm = "", bool useSsl = true, bool useUniqueInstance = true, Microsoft.Xrm.Sdk.Discovery.OrganizationDetail orgDetail = null, Microsoft.IdentityModel.Clients.ActiveDirectory.UserIdentifier user = null, string clientId = ********, System.Uri redirectUri = null, Microsoft.IdentityModel.Clients.ActiveDirectory.PromptBehavior promptBehavior = Never, string tokenCachePath = "", Microsoft.Xrm.Sdk.WebServiceClient.OrganizationWebProxyClient externalOrgWebProxyClient = null, string certificateThumbPrint = null, System.Security.Cryptography.X509Certificates.StoreName certificateStoreName = My, System.Security.Cryptography.X509Certificates.X509Certificate2 certificate = null, System.Uri instanceUrl = {System.Uri}, bool isCloned = false, bool useDefaultCreds = false)	Unknown
 	Microsoft.PowerPlatform.Cds.Client.dll!Microsoft.PowerPlatform.Cds.Client.CdsServiceClient.ConnectToCdsService(string cdsConnectionString = HIDDEN)	Unknown
 	Microsoft.PowerPlatform.Cds.Client.dll!Microsoft.PowerPlatform.Cds.Client.CdsServiceClient.CdsServiceClient(string cdsConnectionString = HIDDEN)	Unknown
>	*****.Core.dll!*****.Core.Extensions.ServiceCollectionExtensions.RegisterClients.AnonymousMethod__1_0(System.IServiceProvider serviceProvider = {Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope}) Line 54	C#
 	Microsoft.Extensions.DependencyInjection.dll!Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(Microsoft.Extensions.DependencyInjection.ServiceLookup.FactoryCallSite factoryCallSite = {Microsoft.Extensions.DependencyInjection.ServiceLookup.FactoryCallSite}, Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeResolverContext context = {Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeResolverContext})	Unknown
 	Microsoft.Extensions.DependencyInjection.dll!Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor<Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeResolverContext, object>.VisitCallSiteMain(Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceCallSite callSite = {Microsoft.Extensions.DependencyInjection.ServiceLookup.FactoryCallSite}, Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeResolverContext argument = {Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeResolverContext})	Unknown
 	Microsoft.Extensions.DependencyInjection.dll!Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceCallSite callSite = {Microsoft.Extensions.DependencyInjection.ServiceLookup.FactoryCallSite}, Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeResolverContext context = {Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeResolverContext}, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope serviceProviderEngine = {Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope}, Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeResolverLock lockType = Scope)	Unknown
 	Microsoft.Extensions.DependencyInjection.dll!Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScopeCache(Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceCallSite singletonCallSite = {Microsoft.Extensions.DependencyInjection.ServiceLookup.FactoryCallSite}, Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeResolverContext context = {Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeResolverContext})	Unknown

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions