Skip to content

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

Closed

Description

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

Activity

  1. MattB-msft commented on Aug 14, 2020

    @MattB-msft
    Member

    If you end the IIS Server ( in the task tray ) and then restart... does it work on next debug session?

  2. BoutemineOualid commented on Aug 14, 2020

    @BoutemineOualid
    Author

    Matthew Mohrman (@matt)

    If you end the IIS Server ( in the task tray ) and then restart... does it work on next debug session?

    Nope, tried stopping the site and relaunching and exiting IIS Express and retrying to no vain.

    FYI, sometimes I had to clone the repo on a different path to sort this out.

  3. BoutemineOualid commented on Aug 14, 2020

    @BoutemineOualid
    Author

    Forgot to mention, I am on 0.2.15-Alpha

  4. MattB-msft commented on Aug 15, 2020

    @MattB-msft
    Member

    What OS / .net core are you using? What version of asp.net?
    And had you installed the .net 5 previews?

    We would like to try to duplicate this situation..

    It sounds like a cache problem.. but that should not survive a stop and restart.

    Thanks

  5. BoutemineOualid commented on Aug 15, 2020

    @BoutemineOualid
    Author

    OS Version
    image

    dotnet core info
    image

    Project References/Packages
    image

    VS Version:
    Microsoft Visual Studio Community 2019
    Version 16.7.1,

    I don't have the .net 5 previews installed.

    Not sure if it's related but I use XrmToolkit VS extension to generate the early bound proxy classes. So far, the easiest way for me to bypass this issue was to use a new and different path to clone my repos. Even If I delete the old folders, then restart the machine and retry cloning at the same old place, I get the exception.

    Let me know if you guys need anything else.

  6. MattB-msft commented on Aug 20, 2020

    @MattB-msft
    Member

    So we have tried to replicate this and are pretty much at a loss.. we cannot get this to reproduce.
    can you add this to your web.config:
    <system.diagnostics> <trace autoflush="true"/> <sources> <source name="Microsoft.PowerPlatform.Cds.Client.CdsServiceClient" switchName="Microsoft.PowerPlatform.Cds.Client.CdsServiceClient" switchType="System.Diagnostics.SourceSwitch"> <listeners> <add name="console" type="System.Diagnostics.ConsoleTraceListener"/> </listeners> </source> <!-- ADAL Log Source --> <source name="Microsoft.IdentityModel.Clients.ActiveDirectory" switchName="Microsoft.IdentityModel.Clients.ActiveDirectory" switchType="System.Diagnostics.SourceSwitch"> <listeners> <add name="console" type="System.Diagnostics.DefaultTraceListener" /> </listeners> </source> </sources> <switches> <!--Possible values for switches: Off, Error, Warning, Information, Verbose Verbose: includes Error, Warning, Info, Trace levels Information: includes Error, Warning, Info levels Warning: includes Error, Warning levels Error: includes Error level--> <add name="Microsoft.PowerPlatform.Cds.Client.CdsServiceClient" value="Verbose"/> <add name="Microsoft.IdentityModel.Clients.ActiveDirectory" value="Error" /> </switches> </system.diagnostics>

    and update add / update a source so that your output is captured ? ( or you can just grab it off the console if your debugging )

    that may help us narrow it down.

  7. BoutemineOualid commented on Aug 21, 2020

    @BoutemineOualid
    Author

    Ok my bad, just reviewed my setup. It seems like it has nothing to do with the cache or anything, the exception is always there regardless. I figured out that I only catch the exception when I select Break when Thrown for all exceptions from "Common Language Runtime Exceptions" in the Exceptions settings window. If I restore to Defaults, I won't see it. Also, the error only happens with the First call to one of my endpoints that rely on the service (If ignore it and just continue, everything works well), afterwards it goes away. It's just annoying when debugging. Also not sure if it's related but, I saw a lot of 401 errors on our App Insights (bellow is an example of an error log):

    image

    Here is what I got on my output window (had to hide some details with '****' that I cannot put here publicly).

    `Application Insights Telemetry: {"name":"AppDependencies","time":"2020-08-21T01:03:55.7051137Z","iKey":"8f97fc8f-4980-4eb8-8fbe-16c1f1b3110c","tags":{"ai.application.ver":"1.0.0.0","ai.cloud.roleInstance":"yannb-portable","ai.operation.id":"64ca30f9f267c948ad516fb812d38a96","ai.operation.parentId":"3b28e56ac69ea346","ai.operation.name":"GET ","ai.location.ip":"::1","ai.internal.sdkVersion":"rdddsc:2.14.0-17971","ai.internal.nodeName":"yannb-portable"},"data":{"baseType":"RemoteDependencyData","baseData":{"ver":2,"name":"GET /5dda54da-ba38-4375-88f8-6420cab22451/v2.0/.well-known/openid-configuration","id":"e4fd19705972934f","data":"https://login.microsoftonline.com/5dda54da-ba38-4375-88f8-6420cab22451/v2.0/.well-known/openid-configuration","duration":"00:00:00.1395739","resultCode":"200","success":true,"type":"Http","target":"login.microsoftonline.com","properties":{"AspNetCoreEnvironment":"Development","_MS.ProcessedByMetricExtractors":"(Name:'Dependencies', Ver:'1.1')","DeveloperMode":"true"}}}}
    Application Insights Telemetry: {"name":"AppDependencies","time":"2020-08-21T01:03:55.8862404Z","iKey":"8f97fc8f-4980-4eb8-8fbe-16c1f1b3110c","tags":{"ai.application.ver":"1.0.0.0","ai.cloud.roleInstance":"yannb-portable","ai.operation.id":"64ca30f9f267c948ad516fb812d38a96","ai.operation.parentId":"3b28e56ac69ea346","ai.operation.name":"GET ","ai.location.ip":"::1","ai.internal.sdkVersion":"rdddsc:2.14.0-17971","ai.internal.nodeName":"yannb-portable"},"data":{"baseType":"RemoteDependencyData","baseData":{"ver":2,"name":"GET /5dda54da-ba38-4375-88f8-6420cab22451/discovery/v2.0/keys","id":"ddc989c61ad3fe41","data":"https://login.microsoftonline.com/5dda54da-ba38-4375-88f8-6420cab22451/discovery/v2.0/keys","duration":"00:00:00.0488096","resultCode":"200","success":true,"type":"Http","target":"login.microsoftonline.com","properties":{"AspNetCoreEnvironment":"Development","_MS.ProcessedByMetricExtractors":"(Name:'Dependencies', Ver:'1.1')","DeveloperMode":"true"}}}}
    'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Users\OualidBoutemine\source\repos*\bin\Debug\netcoreapp3.1\Microsoft.IdentityModel.JsonWebTokens.dll'.
    'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.7\System.Security.Cryptography.Cng.dll'.
    'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.7\System.Security.Cryptography.Csp.dll'.
    'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Users\OualidBoutemine\source\repos*\bin\Debug\netcoreapp3.1\System.Configuration.ConfigurationManager.dll'.
    'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.7\System.Net.WebClient.dll'.
    'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Users\OualidBoutemine\source\repos*\bin\Debug\netcoreapp3.1\Microsoft.IdentityModel.Clients.ActiveDirectory.dll'.
    'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Users\OualidBoutemine\source\repos*\bin\Debug\netcoreapp3.1\System.ServiceModel.Primitives.dll'.
    'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Users\OualidBoutemine\source\repos*
    \bin\Debug\netcoreapp3.1\System.Private.ServiceModel.dll'.
    'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.7\System.Diagnostics.FileVersionInfo.dll'.
    'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Users\OualidBoutemine\source\repos*\bin\Debug\netcoreapp3.1\runtimes\win\lib\netstandard2.0\System.Runtime.Caching.dll'.
    'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Users\OualidBoutemine\source\repos*
    \bin\Debug\netcoreapp3.1\Microsoft.Cds.Sdk.Proxy.dll'.
    'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.7\System.Net.Requests.dll'.
    Exception thrown: 'System.ArgumentNullException' in System.Private.CoreLib.dll
    Value cannot be null.

    'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.7\System.Globalization.dll'.
    'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.7\System.Text.Encoding.dll'.
    Application Insights Telemetry: {"name":"AppMetrics","time":"2020-08-21T01:03:32.0000000Z","iKey":"8f97fc8f-4980-4eb8-8fbe-16c1f1b3110c","tags":{"ai.application.ver":"1.0.0.0","ai.cloud.roleInstance":"yannb-portable","ai.internal.sdkVersion":"m-agg2c:2.14.0-17971","ai.internal.nodeName":"yannb-portable"},"data":{"baseType":"MetricData","baseData":{"ver":2,"metrics":[{"name":"Traces","kind":"Aggregation","value":1,"count":1,"min":1,"max":1,"stdDev":0}],"properties":{"_MS.MetricId":"traces/count","AspNetCoreEnvironment":"Development","cloud/roleInstance":"yannb-portable","_MS.AggregationIntervalMs":"38000","cloud/roleName":"Unknown","DeveloperMode":"true","operation/synthetic":"True","_MS.IsAutocollected":"True","trace/severityLevel":"Unspecified"}}}}
    Application Insights Telemetry: {"name":"AppMetrics","time":"2020-08-21T01:03:32.0000000Z","iKey":"8f97fc8f-4980-4eb8-8fbe-16c1f1b3110c","tags":{"ai.application.ver":"1.0.0.0","ai.cloud.roleInstance":"yannb-portable","ai.internal.sdkVersion":"m-agg2c:2.14.0-17971","ai.internal.nodeName":"yannb-portable"},"data":{"baseType":"MetricData","baseData":{"ver":2,"metrics":[{"name":"Server response time","kind":"Aggregation","value":593.9689,"count":1,"min":593.9689,"max":593.9689,"stdDev":0}],"properties":{"cloud/roleName":"Unknown","_MS.IsAutocollected":"True","AspNetCoreEnvironment":"Development","_MS.AggregationIntervalMs":"38000","cloud/roleInstance":"yannb-portable","request/resultCode":"404","operation/synthetic":"False","_MS.MetricId":"requests/duration","DeveloperMode":"true","request/performanceBucket":"500ms-1sec","Request.Success":"False"}}}}
    Application Insights Telemetry: {"name":"AppMetrics","time":"2020-08-21T01:03:32.0000000Z","iKey":"8f97fc8f-4980-4eb8-8fbe-16c1f1b3110c","tags":{"ai.application.ver":"1.0.0.0","ai.cloud.roleInstance":"yannb-portable","ai.internal.sdkVersion":"m-agg2c:2.14.0-17971","ai.internal.nodeName":"yannb-portable"},"data":{"baseType":"MetricData","baseData":{"ver":2,"metrics":[{"name":"Dependency duration","kind":"Aggregation","value":348.80580000000003,"count":3,"min":48.8096,"max":160.4223,"stdDev":48.45411201256987}],"properties":{"cloud/roleName":"Unknown","dependency/performanceBucket":"<250ms","_MS.IsAutocollected":"True","AspNetCoreEnvironment":"Development","_MS.AggregationIntervalMs":"38000","cloud/roleInstance":"yannb-portable","operation/synthetic":"False","dependency/resultCode":"200","dependency/target":"login.microsoftonline.com","DeveloperMode":"true","_MS.MetricId":"dependencies/duration","Dependency.Type":"Http","Dependency.Success":"True"}}}}
    The thread 0x9d14 has exited with code 0 (0x0).
    Application Insights Telemetry: {"name":"AppDependencies","time":"2020-08-21T01:04:10.8856635Z","iKey":"8f97fc8f-4980-4eb8-8fbe-16c1f1b3110c","tags":{"ai.application.ver":"1.0.0.0","ai.cloud.roleInstance":"yannb-portable","ai.operation.id":"64ca30f9f267c948ad516fb812d38a96","ai.operation.parentId":"3b28e56ac69ea346","ai.operation.name":"GET *********** [interactionId/version]","ai.location.ip":"::1","ai.internal.sdkVersion":"rdddsc:2.14.0-17971","ai.internal.nodeName":"yannb-portable"},"data":{"baseType":"RemoteDependencyData","baseData":{"ver":2,"name":"GET /XRMServices/2011/Organization.svc","id":"592745d9bb81424c","data":"https://.crm3.dynamics.com/XRMServices/2011/Organization.svc/web?SDKClientVersion=9.0.45.3122","duration":"00:00:00.1545154","resultCode":"401","success":false,"type":"WCF Service","target":".crm3.dynamics.com","properties":{"AspNetCoreEnvironment":"Development","_MS.ProcessedByMetricExtractors":"(Name:'Dependencies', Ver:'1.1')","DeveloperMode":"true"}}}}
    Exception thrown: 'Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.HttpRequestWrapperException' in Microsoft.IdentityModel.Clients.ActiveDirectory.dll
    Exception thrown: 'Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.HttpRequestWrapperException' in System.Private.CoreLib.dll
    'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Users\OualidBoutemine\source\repos*
    \bin\Debug\netcoreapp3.1\runtimes\win\lib\netstandard2.0\System.Security.Cryptography.ProtectedData.dll'.
    'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.7\System.Reflection.dll'.
    'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.7\System.Reflection.Extensions.dll'.
    Application Insights Telemetry: {"name":"AppDependencies","time":"2020-08-21T01:04:11.3065359Z","iKey":"8f97fc8f-4980-4eb8-8fbe-16c1f1b3110c","tags":{"ai.application.ver":"1.0.0.0","ai.cloud.roleInstance":"yannb-portable","ai.operation.id":"64ca30f9f267c948ad516fb812d38a96","ai.operation.parentId":"3b28e56ac69ea346","ai.operation.name":"GET ******* [interactionId/version]","ai.location.ip":"::1","ai.internal.sdkVersion":"rdddsc:2.14.0-17971","ai.internal.nodeName":"yannb-portable"},"data":{"baseType":"RemoteDependencyData","baseData":{"ver":2,"name":"GET /common/discovery/instance","id":"aac6b793d6816b48","data":"https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=https://login.microsoftonline.com/5dda54da-ba38-4375-88f8-6420cab22451/oauth2/authorize","duration":"00:00:00.1257906","resultCode":"200","success":true,"type":"Http","target":"login.microsoftonline.com","properties":{"AspNetCoreEnvironment":"Development","_MS.ProcessedByMetricExtractors":"(Name:'Dependencies', Ver:'1.1')","DeveloperMode":"true"}}}}
    'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.7\System.IO.dll'.
    Application Insights Telemetry: {"name":"AppDependencies","time":"2020-08-21T01:04:11.4795464Z","iKey":"8f97fc8f-4980-4eb8-8fbe-16c1f1b3110c","tags":{"ai.application.ver":"1.0.0.0","ai.cloud.roleInstance":"yannb-portable","ai.operation.id":"64ca30f9f267c948ad516fb812d38a96","ai.operation.parentId":"3b28e56ac69ea346","ai.operation.name":"GET ********** [interactionId/version]","ai.location.ip":"::1","ai.internal.sdkVersion":"rdddsc:2.14.0-17971","ai.internal.nodeName":"yannb-portable"},"data":{"baseType":"RemoteDependencyData","baseData":{"ver":2,"name":"POST /5dda54da-ba38-4375-88f8-6420cab22451/oauth2/token","id":"eeee1f5262248941","data":"https://login.microsoftonline.com/5dda54da-ba38-4375-88f8-6420cab22451/oauth2/token","duration":"00:00:00.3400715","resultCode":"200","success":true,"type":"Http","target":"login.microsoftonline.com","properties":{"AspNetCoreEnvironment":"Development","_MS.ProcessedByMetricExtractors":"(Name:'Dependencies', Ver:'1.1')","DeveloperMode":"true"}}}}
    'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Users\OualidBoutemine\source\repos*
    \bin\Debug\netcoreapp3.1\System.ServiceModel.Http.dll'.
    'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.7\System.Net.WebProxy.dll'.
    The thread 0xa608 has exited with code 0 (0x0).
    The thread 0x8a84 has exited with code 0 (0x0).
    The thread 0x1320 has exited with code 0 (0x0).
    'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.7\System.Reflection.DispatchProxy.dll'.
    'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.7\System.Reflection.Emit.dll'.
    'iisexpress.exe' (CoreCLR: clrhost): Loaded 'ProxyBuilder'.
    'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.7\System.Net.WebHeaderCollection.dll'.
    The thread 0xa29c has exited with code 0 (0x0).
    The thread 0x8588 has exited with code 0 (0x0).
    Application Insights Telemetry: {"name":"AppDependencies","time":"2020-08-21T01:04:12.6549847Z","iKey":"8f97fc8f-4980-4eb8-8fbe-16c1f1b3110c","tags":{"ai.application.ver":"1.0.0.0","ai.cloud.roleInstance":"yannb-portable","ai.operation.id":"64ca30f9f267c948ad516fb812d38a96","ai.operation.parentId":"3b28e56ac69ea346","ai.operation.name":"GET ********** [interactionId/version]","ai.location.ip":"::1","ai.internal.sdkVersion":"rdddsc:2.14.0-17971","ai.internal.nodeName":"yannb-portable"},"data":{"baseType":"RemoteDependencyData","baseData":{"ver":2,"name":"POST /XRMServices/2011/Organization.svc","id":"7ac8bf9e35aea14f","data":"https://
    .crm3.dynamics.com:443/XRMServices/2011/Organization.svc/web?SDKClientVersion=9.0.45.3122","duration":"00:00:00.1353663","resultCode":"200","success":true,"type":"WCF Service","target":".crm3.dynamics.com","properties":{"AspNetCoreEnvironment":"Development","_MS.ProcessedByMetricExtractors":"(Name:'Dependencies', Ver:'1.1')","DeveloperMode":"true"}}}}
    'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.7\System.Linq.Queryable.dll'.
    Application Insights Telemetry: {"name":"AppDependencies","time":"2020-08-21T01:04:12.9182279Z","iKey":"8f97fc8f-4980-4eb8-8fbe-16c1f1b3110c","tags":{"ai.application.ver":"1.0.0.0","ai.cloud.roleInstance":"yannb-portable","ai.operation.id":"64ca30f9f267c948ad516fb812d38a96","ai.operation.parentId":"3b28e56ac69ea346","ai.operation.name":"GET *********** [interactionId/version]","ai.location.ip":"::1","ai.internal.sdkVersion":"rdddsc:2.14.0-17971","ai.internal.nodeName":"yannb-portable"},"data":{"baseType":"RemoteDependencyData","baseData":{"ver":2,"name":"POST /XRMServices/2011/Organization.svc","id":"558c08467370d84f","data":"https://
    .crm3.dynamics.com:443/XRMServices/2011/Organization.svc/web?SDKClientVersion=9.0.45.3122","duration":"00:00:00.0450642","resultCode":"200","success":true,"type":"WCF Service","target":".crm3.dynamics.com","properties":{"AspNetCoreEnvironment":"Development","_MS.ProcessedByMetricExtractors":"(Name:'Dependencies', Ver:'1.1')","DeveloperMode":"true"}}}}
    The thread 0x9020 has exited with code 0 (0x0).
    The thread 0x6a44 has exited with code 0 (0x0).
    The thread 0xaf60 has exited with code 0 (0x0).
    The thread 0x4cf4 has exited with code 0 (0x0).
    The thread 0x7e5c has exited with code 0 (0x0).
    Application Insights Telemetry: {"name":"AppDependencies","time":"2020-08-21T01:04:13.1508430Z","iKey":"8f97fc8f-4980-4eb8-8fbe-16c1f1b3110c","tags":{"ai.application.ver":"1.0.0.0","ai.cloud.roleInstance":"yannb-portable","ai.operation.id":"64ca30f9f267c948ad516fb812d38a96","ai.operation.parentId":"3b28e56ac69ea346","ai.operation.name":"GET**************** [interactionId/version]","ai.location.ip":"::1","ai.internal.sdkVersion":"rdddsc:2.14.0-17971","ai.internal.nodeName":"yannb-portable"},"data":{"baseType":"RemoteDependencyData","baseData":{"ver":2,"name":"POST /XRMServices/2011/Organization.svc","id":"6168e02c55bd2b43","data":"https://.crm3.dynamics.com:443/XRMServices/2011/Organization.svc/web?SDKClientVersion=9.0.45.3122","duration":"00:00:00.1456873","resultCode":"200","success":true,"type":"WCF Service","target":"
    .crm3.dynamics.com","properties":{"AspNetCoreEnvironment":"Development","_MS.ProcessedByMetricExtractors":"(Name:'Dependencies', Ver:'1.1')","DeveloperMode":"true"}}}}
    Application Insights Telemetry: {"name":"AppDependencies","time":"2020-08-21T01:04:13.3339700Z","iKey":"8f97fc8f-4980-4eb8-8fbe-16c1f1b3110c","tags":{"ai.application.ver":"1.0.0.0","ai.cloud.roleInstance":"yannb-portable","ai.operation.id":"64ca30f9f267c948ad516fb812d38a96","ai.operation.parentId":"3b28e56ac69ea346","ai.operation.name":"GET************ [interactionId/version]","ai.location.ip":"::1","ai.internal.sdkVersion":"rdddsc:2.14.0-17971","ai.internal.nodeName":"yannb-portable"},"data":{"baseType":"RemoteDependencyData","baseData":{"ver":2,"name":"POST /XRMServices/2011/Organization.svc","id":"d94e64646bcd274c","data":"https://.crm3.dynamics.com:443/XRMServices/2011/Organization.svc/web?SDKClientVersion=9.0.45.3122","duration":"00:00:00.0508511","resultCode":"200","success":true,"type":"WCF Service","target":".crm3.dynamics.com","properties":{"AspNetCoreEnvironment":"Development","_MS.ProcessedByMetricExtractors":"(Name:'Dependencies', Ver:'1.1')","DeveloperMode":"true"}}}}
    'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.7\System.Net.ServicePoint.dll'.
    Application Insights Telemetry: {"name":"AppDependencies","time":"2020-08-21T01:04:14.1114706Z","iKey":"8f97fc8f-4980-4eb8-8fbe-16c1f1b3110c","tags":{"ai.application.ver":"1.0.0.0","ai.cloud.roleInstance":"yannb-portable","ai.operation.id":"64ca30f9f267c948ad516fb812d38a96","ai.operation.parentId":"3b28e56ac69ea346","ai.operation.name":"GET **************** [interactionId/version]","ai.location.ip":"::1","ai.internal.sdkVersion":"rdddsc:2.14.0-17971","ai.internal.nodeName":"yannb-portable"},"data":{"baseType":"RemoteDependencyData","baseData":{"ver":2,"name":"GET *******","id":"d006614d734c554b","data":"
    ","duration":"00:00:00.5299155","resultCode":"200","success":true,"type":"Http (tracked component)","target":" | cid-v1:4709bb51-f56f-4b4c-b1c0-033d83a94dbb","properties":{"AspNetCoreEnvironment":"Development","_MS.ProcessedByMetricExtractors":"(Name:'Dependencies', Ver:'1.1')","DeveloperMode":"true"}}}}
    Application Insights Telemetry: {"name":"AppDependencies","time":"2020-08-21T01:04:14.6792714Z","iKey":"8f97fc8f-4980-4eb8-8fbe-16c1f1b3110c","tags":{"ai.application.ver":"1.0.0.0","ai.cloud.roleInstance":"yannb-portable","ai.operation.id":"64ca30f9f267c948ad516fb812d38a96","ai.operation.parentId":"3b28e56ac69ea346","ai.operation.name":"GET ****************** [interactionId/version]","ai.location.ip":"::1","ai.internal.sdkVersion":"rdddsc:2.14.0-17971","ai.internal.nodeName":"yannb-portable"},"data":{"baseType":"RemoteDependencyData","baseData":{"ver":2,"name":"POST /XRMServices/2011/Organization.svc","id":"3e6d85b452e6f041","data":"https://
    .crm3.dynamics.com:443/XRMServices/2011/Organization.svc/web?SDKClientVersion=9.0.45.3122","duration":"00:00:00.0488213","resultCode":"200","success":true,"type":"WCF Service","target":".crm3.dynamics.com","properties":{"AspNetCoreEnvironment":"Development","_MS.ProcessedByMetricExtractors":"(Name:'Dependencies', Ver:'1.1')","DeveloperMode":"true"}}}}
    'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.7\Microsoft.CSharp.dll'.
    Application Insights Telemetry: {"name":"AppDependencies","time":"2020-08-21T01:04:14.8653522Z","iKey":"8f97fc8f-4980-4eb8-8fbe-16c1f1b3110c","tags":{"ai.application.ver":"1.0.0.0","ai.cloud.roleInstance":"yannb-portable","ai.operation.id":"64ca30f9f267c948ad516fb812d38a96","ai.operation.parentId":"3b28e56ac69ea346","ai.operation.name":"GET ************ [interactionId/version]","ai.location.ip":"::1","ai.internal.sdkVersion":"rdddsc:2.14.0-17971","ai.internal.nodeName":"yannb-portable"},"data":{"baseType":"RemoteDependencyData","baseData":{"ver":2,"name":"POST /XRMServices/2011/Organization.svc","id":"054259917510674f","data":"https://
    .crm3.dynamics.com:443/XRMServices/2011/Organization.svc/web?SDKClientVersion=9.0.45.3122","duration":"00:00:00.0438599","resultCode":"200","success":true,"type":"WCF Service","target":".crm3.dynamics.com","properties":{"AspNetCoreEnvironment":"Development","_MS.ProcessedByMetricExtractors":"(Name:'Dependencies', Ver:'1.1')","DeveloperMode":"true"}}}}
    'iisexpress.exe' (CoreCLR: clrhost): Loaded 'C:\Users\OualidBoutemine\source\repos*
    \bin\Debug\netcoreapp3.1\Microsoft.Rest.ClientRuntime.dll'.
    Application Insights Telemetry: {"name":"AppDependencies","time":"2020-08-21T01:04:14.9790566Z","iKey":"8f97fc8f-4980-4eb8-8fbe-16c1f1b3110c","tags":{"ai.application.ver":"1.0.0.0","ai.cloud.roleInstance":"yannb-portable","ai.operation.id":"64ca30f9f267c948ad516fb812d38a96","ai.operation.parentId":"3b28e56ac69ea346","ai.operation.name":"GET ****************** [interactionId/version]","ai.location.ip":"::1","ai.internal.sdkVersion":"rdddsc:2.14.0-17971","ai.internal.nodeName":"yannb-portable"},"data":{"baseType":"RemoteDependencyData","baseData":{"ver":2,"name":"Patch /api/data/v9.1/incidents(54340eff-6395-4e44-81c3-89eed0abda71)","id":"14131431450ca046","data":"https://
    .api.crm3.dynamics.com/api/data/v9.1/incidents(54340eff-6395-4e44-81c3-89eed0abda71)","duration":"00:00:00.4273371","resultCode":"204","success":true,"type":"Http","target":".api.crm3.dynamics.com","properties":{"AspNetCoreEnvironment":"Development","_MS.ProcessedByMetricExtractors":"(Name:'Dependencies', Ver:'1.1')","DeveloperMode":"true"}}}}
    Application Insights Telemetry: {"name":"AppTraces","time":"2020-08-21T01:04:15.4284084Z","iKey":"8f97fc8f-4980-4eb8-8fbe-16c1f1b3110c","tags":{"ai.application.ver":"1.0.0.0","ai.cloud.roleInstance":"yannb-portable","ai.operation.id":"64ca30f9f267c948ad516fb812d38a96","ai.operation.parentId":"3b28e56ac69ea346","ai.operation.name":"GET ************ [interactionId/version]","ai.location.ip":"::1","ai.internal.sdkVersion":"il:2.14.0-17971","ai.internal.nodeName":"yannb-portable"},"data":{"baseType":"MessageData","baseData":{"ver":2,"message":"********","severityLevel":"Information","properties":{"{OriginalFormat}":"
    ","ApiVersion":"1","RequestPath":"**************","RequestId":"80000064-0009-ff00-b63f-84710c7967bb","TraceId":"64ca30f9f267c948ad516fb812d38a96","AspNetCoreEnvironment":"Development","ParentId":"0000000000000000","RequesterAppName":"CRM","ActionId":"e47f3a63-6c94-430c-b165-a4969cb24d03","ContactId":"00000000-0000-0000-0000-000000000000","SpanId":"3b28e56ac69ea346","RequesterAppId":"68372f7b-fe17-4db4-98ba-d0709df3fa3a","DeveloperMode":"true","CategoryName":"","ActionName":"***********","ScopeName":"","InteractionId":"54340eff-6395-4e44-81c3-89eed0abda71","":"**********"}}}}
    Application Insights Telemetry: {"name":"AppRequests","time":"2020-08-21T01:03:55.6435006Z","iKey":"8f97fc8f-4980-4eb8-8fbe-16c1f1b3110c","tags":{"ai.application.ver":"1.0.0.0","ai.cloud.roleInstance":"yannb-portable","ai.operation.id":"64ca30f9f267c948ad516fb812d38a96","ai.operation.name":"GET [interactionId/version]","ai.location.ip":"::1","ai.internal.sdkVersion":"aspnet5c:2.14.0","ai.internal.nodeName":"yannb-portable"},"data":{"baseType":"RequestData","baseData":{"ver":2,"id":"3b28e56ac69ea346","name":"GET [interactionId/version]","duration":"00:00:19.8338993","success":true,"responseCode":"200","url":"
    ","properties":{"AspNetCoreEnvironment":"Development","_MS.ProcessedByMetricExtractors":"(Name:'Requests', Ver:'1.1')","DeveloperMode":"true"}}}}
    `

  8. MattB-msft commented on Aug 21, 2020

    @MattB-msft
    Member

    ok, the 401's are expected, but that your getting a lot of them indicates that your not using the .clone mechanic and are trying to create a connection on each page operation vs using a cached connection.

    We use a challenge response process to decode the Resource and authorities to use to connect.

    Collin, one of our MVP's, published a blog post on this.. here: https://colinvermander.com/2020/03/26/cdsserviceclient-with-asp-net-core/

    This is an extension of the same pattern we have presented in the use of CrmServiceClient for Asp.net,
    Using the pattern you should see a single 401 for the initial connection, and subsequent connections should clone off that.
    Is that the pattern your using?

    thanks

  9. BoutemineOualid commented on Aug 21, 2020

    @BoutemineOualid
    Author

    Yep I imported but have not pushed a new build to the prod environment. I will see how that plays out next week. Thanks

  10. linked a pull request that will close this issueRelease/update/200826083404 #49on Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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