Skip to content

Commit 3b6093a

Browse files
Copilotjmprieur
andcommitted
Address PR feedback: revert NuGet.config, use C# 14 instead of preview
Co-authored-by: jmprieur <13203188+jmprieur@users.noreply.github.com>
1 parent 60731d7 commit 3b6093a

4 files changed

Lines changed: 7 additions & 9 deletions

File tree

Directory.Build.props

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,9 @@
3939
<AssemblyOriginatorKeyFile>../../build/MSAL.snk</AssemblyOriginatorKeyFile>
4040
<GenerateDocumentationFile>true</GenerateDocumentationFile>
4141
<Nullable>enable</Nullable>
42-
<!-- LangVersion set to preview to enable C# 15 extension properties for .NET 10+ AOT compatibility.
43-
Extension properties are required to make CredentialDescription AOT-safe while maintaining source compatibility.
44-
Once C# 15 is finalized, this should be updated to the specific version number (e.g., 15). -->
45-
<LangVersion>preview</LangVersion>
42+
<!-- LangVersion set to 14 to enable C# 14 extension properties for .NET 10+ AOT compatibility.
43+
Extension properties are required to make CredentialDescription AOT-safe while maintaining source compatibility. -->
44+
<LangVersion>14</LangVersion>
4645
<EnablePackageValidation>true</EnablePackageValidation>
4746
<PackageValidationBaselineVersion>8.0.0</PackageValidationBaselineVersion>
4847
<BannedApiAnalyzersVersion>4.14.0</BannedApiAnalyzersVersion>

NuGet.config

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33
<packageSources>
44
<clear />
55
<add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" />
6-
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
76
</packageSources>
87
</configuration>

changelog.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ In practice, it's unlikely that this breaking change affects anybody as the rena
99

1010
### AOT/NativeAOT Compatibility for .NET 10+
1111

12-
Made `CredentialDescription` AOT-compatible for .NET 10+ by using C# 15 extension properties. This change:
12+
Made `CredentialDescription` AOT-compatible for .NET 10+ by using C# 14 extension properties. This change:
1313
- Removes `Certificate` and `CachedValue` as public properties from `CredentialDescription` when targeting .NET 10+
1414
- Adds extension properties with the same names and signatures for .NET 10+, providing property-style access
1515
- Maintains full source compatibility - no code changes required for consumers
@@ -19,7 +19,7 @@ Made `CredentialDescription` AOT-compatible for .NET 10+ by using C# 15 extensio
1919
**Technical details:**
2020
- For .NET 10+: `Certificate` and `CachedValue` are implemented as extension properties (not visible to config binders)
2121
- For older TFMs: `Certificate` and `CachedValue` remain as regular public properties
22-
- LangVersion updated to `preview` to enable C# 15 extension property syntax
22+
- LangVersion updated to `14` to enable C# 14 extension property syntax
2323
- Internal accessor methods (`GetCertificateInternal`, `SetCertificateInternal`, etc.) support extension properties
2424

2525
This enhancement ensures `CredentialDescription` works seamlessly in AOT/NativeAOT compilation scenarios while maintaining backward compatibility.

src/Microsoft.Identity.Abstractions/ApplicationOptions/CredentialDescriptionExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ namespace Microsoft.Identity.Abstractions
1212
/// while keeping them hidden from AOT/NativeAOT configuration binders.
1313
/// </summary>
1414
/// <remarks>
15-
/// This uses C# 15 extension property syntax. The extension block defines properties that appear
15+
/// This uses C# 14 extension property syntax. The extension block defines properties that appear
1616
/// as instance properties on CredentialDescription but are not part of the type's public API surface
1717
/// visible to reflection-based tools like configuration binders.
1818
/// </remarks>
1919
public static class CredentialDescriptionExtensions
2020
{
21-
// C# 15 extension block syntax - defines extension properties on CredentialDescription
21+
// C# 14 extension block syntax - defines extension properties on CredentialDescription
2222
extension(CredentialDescription credential)
2323
{
2424
/// <summary>

0 commit comments

Comments
 (0)