Skip to content

Commit 7aadd0f

Browse files
baronfelgewarren
andauthored
Update strong naming guidance for .NET libraries to only apply to applicable platforms (#49026)
* Update strong naming guidance for .NET libraries to only apply to applicable platforms Since Strong Naming has no impact on modern .NET Runtimes, limit the scope of guidance to .NET Framework and .NET Standard * Update docs/standard/library-guidance/strong-naming.md Co-authored-by: Genevieve Warren <[email protected]> * clarify multi-targeting guidelines If multitargeting, strong naming should be done for all TFMs so that InternalsVisibleTo attributes can remain consistent. * fix spacing --------- Co-authored-by: Genevieve Warren <[email protected]>
1 parent 330c1a3 commit 7aadd0f

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

docs/standard/library-guidance/strong-naming.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Strong naming and .NET libraries
33
description: Best practice recommendations for strong naming .NET libraries.
4-
ms.date: 10/16/2018
4+
ms.date: 10/13/2025
55
---
66
# Strong naming
77

@@ -34,14 +34,18 @@ The benefits of strong naming on .NET Framework are:
3434

3535
Strong naming has no benefits on .NET Core/5+. C# compiler produces CS8002 warning for strong-named assemblies referencing non-strong named assemblies. It is fine to suppress this warning for libraries that target .NET Core/5+ only.
3636

37-
## Create strong named .NET libraries
37+
## When to strong name .NET libraries
3838

39-
You should strong name your open-source .NET libraries if their targets include .NET Framework or .NET Standard. Strong naming is not required for libraries that target .NET Core/5+ only.
39+
Strong naming is not required for libraries that target .NET Core/5+ only. You should strong name your open-source .NET libraries if their targets include .NET Framework or .NET Standard.
4040

4141
> [!NOTE]
4242
> This guidance is specific to publicly distributed .NET libraries, such as .NET libraries published on NuGet.org. Strong naming is not required by most .NET applications and should not be done by default.
4343
44-
✔️ CONSIDER strong naming your library's assemblies.
44+
✔️ CONSIDER strong naming your library's assemblies if you only target .NET Framework or .NET Standard.
45+
46+
> Strong naming has no impact on modern .NET runtimes. If your library only targets modern .NET, then you don't need to strong name your assemblies.
47+
48+
> If you multi-target across .NET Framework/.NET Standard _and_ modern .NET, then you should strong name across all of your Target Frameworks.
4549
4650
✔️ CONSIDER adding the strong naming key pair (public + private) to your source control system.
4751

0 commit comments

Comments
 (0)