From 84ca155b9710752025344fe26d2e1655b309ad58 Mon Sep 17 00:00:00 2001 From: Release-Agent <> Date: Wed, 8 Nov 2023 00:15:50 +0000 Subject: [PATCH] '' --- .../Client/Auth/TokenCache/FileBackedTokenCacheHints.cs | 7 +++++++ .../DataverseClient/Client/ConnectionService.cs | 5 +++++ .../DataverseClient/Client/Model/GlobalDiscoveryModel.cs | 8 ++++---- src/GeneralTools/DataverseClient/Client/Utils/Utils.cs | 2 +- ...rosoft.PowerPlatform.Dataverse.Client.ReleaseNotes.txt | 1 + 5 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/GeneralTools/DataverseClient/Client/Auth/TokenCache/FileBackedTokenCacheHints.cs b/src/GeneralTools/DataverseClient/Client/Auth/TokenCache/FileBackedTokenCacheHints.cs index bb0d538..674499c 100644 --- a/src/GeneralTools/DataverseClient/Client/Auth/TokenCache/FileBackedTokenCacheHints.cs +++ b/src/GeneralTools/DataverseClient/Client/Auth/TokenCache/FileBackedTokenCacheHints.cs @@ -37,6 +37,13 @@ public FileBackedTokenCacheHints(string tokenPathAndFileName) if (AppDomain.CurrentDomain != null) { hostName = Path.GetFileNameWithoutExtension(AppDomain.CurrentDomain.FriendlyName); + if (hostName.IndexOfAny(Path.GetInvalidFileNameChars()) < 0) + { + foreach (var c in Path.GetInvalidFileNameChars()) + { + hostName = hostName.Replace(c, '_'); + } + } } string hostVersion = Environs.XrmSdkFileVersion; string companyName = typeof(OrganizationDetail).Assembly.GetCustomAttribute().Company; diff --git a/src/GeneralTools/DataverseClient/Client/ConnectionService.cs b/src/GeneralTools/DataverseClient/Client/ConnectionService.cs index f66008a..fd00df1 100644 --- a/src/GeneralTools/DataverseClient/Client/ConnectionService.cs +++ b/src/GeneralTools/DataverseClient/Client/ConnectionService.cs @@ -1750,6 +1750,9 @@ private async Task RefreshInstanceDetails(IOrganizationService dvService, Uri ur _OrgDetail.UniqueName = resp.Detail.UniqueName; _OrgDetail.UrlName = resp.Detail.UrlName; _OrgDetail.DatacenterId = resp.Detail.DatacenterId; + _OrgDetail.SchemaType = resp.Detail.SchemaType; + _OrgDetail.OrganizationType = resp.Detail.OrganizationType; + } _organization = _OrgDetail.UniqueName; @@ -3007,6 +3010,8 @@ private static async Task QueryGlobalDiscoveryAsyn d.EnvironmentId = !string.IsNullOrEmpty(inst.EnvironmentId) ? inst.EnvironmentId : string.Empty; d.Geo = !string.IsNullOrEmpty(inst.Region) ? inst.Region : string.Empty; d.TenantId = !string.IsNullOrEmpty(inst.TenantId) ? inst.TenantId : string.Empty; + d.SchemaType = !string.IsNullOrEmpty(inst.SchemaType) ? inst.SchemaType : string.Empty; + d.OrganizationType = (Xrm.Sdk.Organization.OrganizationType)Enum.Parse(typeof(Xrm.Sdk.Organization.OrganizationType), inst.OrganizationType.ToString()); System.Reflection.PropertyInfo proInfo = d.GetType().GetProperty("Endpoints"); if (proInfo != null) { diff --git a/src/GeneralTools/DataverseClient/Client/Model/GlobalDiscoveryModel.cs b/src/GeneralTools/DataverseClient/Client/Model/GlobalDiscoveryModel.cs index 4aa6df3..dc8ff21 100644 --- a/src/GeneralTools/DataverseClient/Client/Model/GlobalDiscoveryModel.cs +++ b/src/GeneralTools/DataverseClient/Client/Model/GlobalDiscoveryModel.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; @@ -49,7 +49,7 @@ internal class GlobalDiscoveryInstanceModel public DateTime TrialExpirationDate { get; set; } [JsonProperty(PropertyName = "Purpose")] public string Purpose { get; set; } - - - } + [JsonProperty(PropertyName = "SchemaType")] + public string SchemaType { get; set; } + } } diff --git a/src/GeneralTools/DataverseClient/Client/Utils/Utils.cs b/src/GeneralTools/DataverseClient/Client/Utils/Utils.cs index 9cdff82..3cee3af 100644 --- a/src/GeneralTools/DataverseClient/Client/Utils/Utils.cs +++ b/src/GeneralTools/DataverseClient/Client/Utils/Utils.cs @@ -43,7 +43,7 @@ internal static DiscoveryServer GetDiscoveryServerByUri(Uri orgUri) using (DiscoveryServers discoSvcs = new DiscoveryServers()) { return discoSvcs.GetServerByShortName(OnlineRegon); - }; + } } } return null; diff --git a/src/nuspecs/Microsoft.PowerPlatform.Dataverse.Client.ReleaseNotes.txt b/src/nuspecs/Microsoft.PowerPlatform.Dataverse.Client.ReleaseNotes.txt index ab095c0..c76ae95 100644 --- a/src/nuspecs/Microsoft.PowerPlatform.Dataverse.Client.ReleaseNotes.txt +++ b/src/nuspecs/Microsoft.PowerPlatform.Dataverse.Client.ReleaseNotes.txt @@ -9,6 +9,7 @@ Notice: ++CURRENTRELEASEID++ Updated Core SDK Added new properties to Organization detail to report Schema Type and Deployment Type. +Fixed bug in creating file to user token cache when host name contains invalid characters. Fixes #406 Dependency changes: System.Text.Json moved to 7.0.3 Microsoft.Identity.Client moved to 4.56.0