Skip to content

Commit cb2023c

Browse files
Update SYSLIB0012 obsoletion messages to be clear and consistent (#41483)
Co-authored-by: Jeff Handley <jeff.handley@microsoft.com>
1 parent d5e0627 commit cb2023c

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

docs/project/list-of-obsoletions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ Currently the identifiers `SYSLIB0001` through `SYSLIB0999` are carved out for o
2424
| __`SYSLIB0009`__ | The AuthenticationManager Authenticate and PreAuthenticate methods are not supported and throw PlatformNotSupportedException. |
2525
| __`SYSLIB0010`__ | This Remoting API is not supported and throws PlatformNotSupportedException. |
2626
| __`SYSLIB0011`__ | `BinaryFormatter` serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for recommended alternatives. |
27-
| __`SYSLIB0012`__ | Use Location instead. |
27+
| __`SYSLIB0012`__ | Assembly.CodeBase and Assembly.EscapedCodeBase are only included for .NET Framework compatibility. Use Assembly.Location instead. |

src/libraries/Common/src/System/Obsoletions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ internal static class Obsoletions
4040
internal const string BinaryFormatterMessage = "BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.";
4141
internal const string BinaryFormatterDiagId = "SYSLIB0011";
4242

43-
internal const string CodeBaseMessage = "Use Location instead.";
43+
internal const string CodeBaseMessage = "Assembly.CodeBase and Assembly.EscapedCodeBase are only included for .NET Framework compatibility. Use Assembly.Location instead.";
4444
internal const string CodeBaseDiagId = "SYSLIB0012";
4545
}
4646
}

src/libraries/System.Reflection.Emit/ref/System.Reflection.Emit.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace System.Reflection.Emit
99
public sealed partial class AssemblyBuilder : System.Reflection.Assembly
1010
{
1111
internal AssemblyBuilder() { }
12-
[System.ObsoleteAttribute("CodeBase and EscapedCodeBase are only included for .NET Framework compatibility. Use Location instead.", DiagnosticId = "SYSLIB0012", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
12+
[System.ObsoleteAttribute("Assembly.CodeBase and Assembly.EscapedCodeBase are only included for .NET Framework compatibility. Use Assembly.Location instead.", DiagnosticId = "SYSLIB0012", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
1313
public override string? CodeBase { get { throw null; } }
1414
public override System.Reflection.MethodInfo? EntryPoint { get { throw null; } }
1515
public override string? FullName { get { throw null; } }

src/libraries/System.Runtime/ref/System.Runtime.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7585,12 +7585,12 @@ public AmbiguousMatchException(string? message, System.Exception? inner) { }
75857585
public abstract partial class Assembly : System.Reflection.ICustomAttributeProvider, System.Runtime.Serialization.ISerializable
75867586
{
75877587
protected Assembly() { }
7588-
[System.ObsoleteAttribute("CodeBase and EscapedCodeBase are only included for .NET Framework compatibility. Use Location instead.", DiagnosticId = "SYSLIB0012", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
7588+
[System.ObsoleteAttribute("Assembly.CodeBase and Assembly.EscapedCodeBase are only included for .NET Framework compatibility. Use Assembly.Location instead.", DiagnosticId = "SYSLIB0012", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
75897589
public virtual string? CodeBase { get { throw null; } }
75907590
public virtual System.Collections.Generic.IEnumerable<System.Reflection.CustomAttributeData> CustomAttributes { get { throw null; } }
75917591
public virtual System.Collections.Generic.IEnumerable<System.Reflection.TypeInfo> DefinedTypes { [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types might be removed")] get { throw null; } }
75927592
public virtual System.Reflection.MethodInfo? EntryPoint { get { throw null; } }
7593-
[System.ObsoleteAttribute("CodeBase and EscapedCodeBase are only included for .NET Framework compatibility. Use Location instead.", DiagnosticId = "SYSLIB0012", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
7593+
[System.ObsoleteAttribute("Assembly.CodeBase and Assembly.EscapedCodeBase are only included for .NET Framework compatibility. Use Assembly.Location instead.", DiagnosticId = "SYSLIB0012", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
75947594
public virtual string EscapedCodeBase { get { throw null; } }
75957595
public virtual System.Collections.Generic.IEnumerable<System.Type> ExportedTypes { [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types might be removed")] get { throw null; } }
75967596
public virtual string? FullName { get { throw null; } }

0 commit comments

Comments
 (0)