You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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]>
Copy file name to clipboardExpand all lines: docs/standard/library-guidance/strong-naming.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Strong naming and .NET libraries
3
3
description: Best practice recommendations for strong naming .NET libraries.
4
-
ms.date: 10/16/2018
4
+
ms.date: 10/13/2025
5
5
---
6
6
# Strong naming
7
7
@@ -34,14 +34,18 @@ The benefits of strong naming on .NET Framework are:
34
34
35
35
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.
36
36
37
-
## Create strong named .NET libraries
37
+
## When to strong name .NET libraries
38
38
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.
40
40
41
41
> [!NOTE]
42
42
> 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.
43
43
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.
45
49
46
50
✔️ CONSIDER adding the strong naming key pair (public + private) to your source control system.
0 commit comments