diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 13d4defd0..4943396df 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -64,22 +64,7 @@ - - $(DefineConstants);DOTNET_50_AND_ABOVE - - - - $(DefineConstants);DOTNET_472 - 8.0 - - - - $(DefineConstants);DOTNET_462 - 8.0 - - - - $(DefineConstants);DOTNET_STANDARD_20 + 8.0 diff --git a/src/Microsoft.Identity.Web.Certificate/CertificateDescription.cs b/src/Microsoft.Identity.Web.Certificate/CertificateDescription.cs index 272592966..98302f103 100644 --- a/src/Microsoft.Identity.Web.Certificate/CertificateDescription.cs +++ b/src/Microsoft.Identity.Web.Certificate/CertificateDescription.cs @@ -238,7 +238,7 @@ internal string? Container /// public string? Base64EncodedValue { get; set; } -#if DOTNET_462 || DOTNET_STANDARD_20 +#if NET462 || NETSTANDARD2_0 /// /// Defines where and how to import the private key of an X.509 certificate. /// diff --git a/src/Microsoft.Identity.Web.Certificate/DefaultCertificateLoader.cs b/src/Microsoft.Identity.Web.Certificate/DefaultCertificateLoader.cs index e573dc9ca..1f0546427 100644 --- a/src/Microsoft.Identity.Web.Certificate/DefaultCertificateLoader.cs +++ b/src/Microsoft.Identity.Web.Certificate/DefaultCertificateLoader.cs @@ -275,7 +275,7 @@ private static X509Certificate2 LoadFromPath( string certificateFileName, string? password = null) { -#if DOTNET_462 || DOTNET_STANDARD_20 +#if NET462 || NETSTANDARD2_0 return new X509Certificate2( certificateFileName, password, diff --git a/src/Microsoft.Identity.Web/DownstreamWebApiSupport/DownstreamWebApi.cs b/src/Microsoft.Identity.Web/DownstreamWebApiSupport/DownstreamWebApi.cs index 50a7b6d61..de5e81071 100644 --- a/src/Microsoft.Identity.Web/DownstreamWebApiSupport/DownstreamWebApi.cs +++ b/src/Microsoft.Identity.Web/DownstreamWebApiSupport/DownstreamWebApi.cs @@ -124,7 +124,7 @@ public async Task CallWebApiForUserAsync( { string error = await response.Content.ReadAsStringAsync().ConfigureAwait(false); -#if DOTNET_50_AND_ABOVE +#if NET5_0_OR_GREATER throw new HttpRequestException($"{(int)response.StatusCode} {response.StatusCode} {error}", null, response.StatusCode); #else throw new HttpRequestException($"{(int)response.StatusCode} {response.StatusCode} {error}"); diff --git a/src/Microsoft.Identity.Web/DownstreamWebApiSupport/DownstreamWebApiGenericExtensions.cs b/src/Microsoft.Identity.Web/DownstreamWebApiSupport/DownstreamWebApiGenericExtensions.cs index 660a4ffa9..d718c97c1 100644 --- a/src/Microsoft.Identity.Web/DownstreamWebApiSupport/DownstreamWebApiGenericExtensions.cs +++ b/src/Microsoft.Identity.Web/DownstreamWebApiSupport/DownstreamWebApiGenericExtensions.cs @@ -294,7 +294,7 @@ private static StringContent ConvertFromInput(TInput input) { string error = await response.Content.ReadAsStringAsync().ConfigureAwait(false); -#if DOTNET_50_AND_ABOVE +#if NET5_0_OR_GREATER throw new HttpRequestException($"{(int)response.StatusCode} {response.StatusCode} {error}", null, response.StatusCode); #else throw new HttpRequestException($"{(int)response.StatusCode} {response.StatusCode} {error}"); diff --git a/src/Microsoft.Identity.Web/JwtBearerMergedOptions.cs b/src/Microsoft.Identity.Web/JwtBearerMergedOptions.cs index dc7967745..62ce469c1 100644 --- a/src/Microsoft.Identity.Web/JwtBearerMergedOptions.cs +++ b/src/Microsoft.Identity.Web/JwtBearerMergedOptions.cs @@ -19,7 +19,7 @@ public static void UpdateJwtBearerOptionsFromJwtBearerOptions(JwtBearerOptions j jwtBearerMergedOptions.Authority = jwtBearerOptions.Authority; } -#if DOTNET_50_AND_ABOVE +#if NET5_0_OR_GREATER jwtBearerMergedOptions.AutomaticRefreshInterval = jwtBearerOptions.AutomaticRefreshInterval; #endif @@ -72,7 +72,7 @@ public static void UpdateJwtBearerOptionsFromJwtBearerOptions(JwtBearerOptions j jwtBearerMergedOptions.IncludeErrorDetails = jwtBearerOptions.IncludeErrorDetails; -#if DOTNET_50_AND_ABOVE +#if NET5_0 jwtBearerMergedOptions.MapInboundClaims = jwtBearerOptions.MapInboundClaims; #endif @@ -81,7 +81,7 @@ public static void UpdateJwtBearerOptionsFromJwtBearerOptions(JwtBearerOptions j jwtBearerMergedOptions.MetadataAddress = jwtBearerOptions.MetadataAddress; } -#if DOTNET_50_AND_ABOVE +#if NET5_0 jwtBearerMergedOptions.RefreshInterval = jwtBearerOptions.RefreshInterval; #endif diff --git a/src/Microsoft.Identity.Web/WebAppExtensions/MicrosoftIdentityWebAppAuthenticationBuilderExtensions.cs b/src/Microsoft.Identity.Web/WebAppExtensions/MicrosoftIdentityWebAppAuthenticationBuilderExtensions.cs index 69253e163..525276eeb 100644 --- a/src/Microsoft.Identity.Web/WebAppExtensions/MicrosoftIdentityWebAppAuthenticationBuilderExtensions.cs +++ b/src/Microsoft.Identity.Web/WebAppExtensions/MicrosoftIdentityWebAppAuthenticationBuilderExtensions.cs @@ -462,7 +462,7 @@ private static void PopulateOpenIdOptionsFromMergedOptions( options.DisableTelemetry = mergedOptions.DisableTelemetry; options.NonceCookie = mergedOptions.NonceCookie; options.UsePkce = mergedOptions.UsePkce; -#if DOTNET_50_AND_ABOVE +#if NET5_0_OR_GREATER options.AutomaticRefreshInterval = mergedOptions.AutomaticRefreshInterval; options.RefreshInterval = mergedOptions.RefreshInterval; options.MapInboundClaims = mergedOptions.MapInboundClaims; diff --git a/tests/Microsoft.Identity.Web.Test/Certificates/CertificateDescriptionTests.cs b/tests/Microsoft.Identity.Web.Test/Certificates/CertificateDescriptionTests.cs index 799f4d05b..221eec649 100644 --- a/tests/Microsoft.Identity.Web.Test/Certificates/CertificateDescriptionTests.cs +++ b/tests/Microsoft.Identity.Web.Test/Certificates/CertificateDescriptionTests.cs @@ -18,7 +18,7 @@ public void TestFromKeyVault(string keyVaultUrl, string certificateName) Assert.Equal(certificateName, certificateDescription.ReferenceOrValue); Assert.Equal(certificateName, certificateDescription.KeyVaultCertificateName); Assert.Equal(keyVaultUrl, certificateDescription.KeyVaultUrl); -#if DOTNET_462 +#if NET462 Assert.Equal(X509KeyStorageFlags.MachineKeySet, certificateDescription.X509KeyStorageFlags); #else Assert.Equal(X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.EphemeralKeySet, certificateDescription.X509KeyStorageFlags);