8000 Remove old fwlink from Obsolete messages and make message improvement… · dotnet/runtime@895c99c · GitHub
[go: up one dir, main page]

Skip to content

Commit 895c99c

Browse files
authored
Remove old fwlink from Obsolete messages and make message improvements (#56690)
* Remove old fwlink from Obsolete messages and make message improvements * Thorough review and update of Obsolete messages * Cleanup * Make messages about unsupported APIs more consistent * Update RequiresUnreferencedCodeAttribute messages to be consistent between ref and src * Cleanup * Cleanup * Use 'not supported' instead of 'no longer supported' * Omit unnecessary error:false from Obsolete attributes. Fix message typo. * Remove old comment * PR feedback
1 parent 9d9aed6 commit 895c99c

File tree

162 files changed

+467
-468
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+467
-468
lines changed

docs/project/list-of-diagnostics.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ The PR that reveals the implementation of the `<IncludeInternalObsoleteAttribute
7373
| __`SYSLIB0016`__ | Use the Graphics.GetContextInfo overloads that accept arguments for better performance and fewer allocations. |
7474
| __`SYSLIB0017`__ | Strong name signing is not supported and throws PlatformNotSupportedException. |
7575
| __`SYSLIB0018`__ | ReflectionOnly loading is not supported and throws PlatformNotSupportedException. |
76-
| __`SYSLIB0019`__ | RuntimeEnvironment members SystemConfigurationFile, GetRuntimeInterfaceAsIntPtr, and GetRuntimeInterfaceAsObject are no longer supported and throw PlatformNotSupportedException. |
76+
| __`SYSLIB0019`__ | RuntimeEnvironment members SystemConfigurationFile, GetRuntimeInterfaceAsIntPtr, and GetRuntimeInterfaceAsObject are not supported and throw PlatformNotSupportedException. |
7777
| __`SYSLIB0020`__ | JsonSerializerOptions.IgnoreNullValues is obsolete. To ignore null values when serializing, set DefaultIgnoreCondition to JsonIgnoreCondition.WhenWritingNull. |
7878
| __`SYSLIB0021`__ | Derived cryptographic types are obsolete. Use the Create method on the base type instead. |
7979
| __`SYSLIB0022`__ | The Rijndael and RijndaelManaged types are obsolete. Use Aes instead. |
@@ -83,7 +83,7 @@ The PR that reveals the implementation of the `<IncludeInternalObsoleteAttribute
8383
| __`SYSLIB0026`__ | X509Certificate and X509Certificate2 are immutable. Use the appropriate constructor to create a new certificate. |
8484
| __`SYSLIB0027`__ | PublicKey.Key is obsolete. Use the appropriate method to get the public key, such as GetRSAPublicKey. |
8585
| __`SYSLIB0028`__ | X509Certificate2.PrivateKey is obsolete. Use the appropriate method to get the private key, such as GetRSAPrivateKey, or use the CopyWithPrivateKey method to create a new instance with a private key. |
86-
| __`SYSLIB0029`__ | ProduceLegacyHmacValues is obsolete. Producing legacy HMAC values is no longer supported. |
86+
| __`SYSLIB0029`__ | ProduceLegacyHmacValues is obsolete. Producing legacy HMAC values is not supported. |
8787
| __`SYSLIB0030`__ | HMACSHA1 always uses the algorithm implementation provided by the platform. Use a constructor without the useManagedSha1 parameter. |
8888
| __`SYSLIB0031`__ | EncodeOID is obsolete. Use the ASN.1 functionality provided in System.Formats.Asn1. |
8989
| __`SYSLIB0032`__ | Recovery from corrupted process state exceptions is not supported; HandleProcessCorruptedStateExceptionsAttribute is ignored. |

src/coreclr/System.Private.CoreLib/src/System/Reflection/Assembly.CoreCLR.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public static Assembly Load(string assemblyString)
2121
return RuntimeAssembly.InternalLoad(assemblyString, ref stackMark, AssemblyLoadContext.CurrentContextualReflectionContext);
2222
}
2323

24-
[Obsolete("This method has been deprecated. Please use Assembly.Load() instead. https://go.microsoft.com/fwlink/?linkid=14202")]
24+
[Obsolete("Assembly.LoadWithPartialName has been deprecated. Use Assembly.Load() instead.")]
2525
[System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod
2626
public static Assembly? LoadWithPartialName(string partialName)
2727
{

src/coreclr/System.Private.CoreLib/src/System/Threading/Overlapped.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public Overlapped(int offsetLo, int offsetHi, IntPtr hEvent, IAsyncResult? ar) :
171171
_overlappedData._asyncResult = ar;
172172
}
173173

174-
[Obsolete("This constructor is not 64-bit compatible. Use the constructor that takes an IntPtr for the event handle. https://go.microsoft.com/fwlink/?linkid=14202")]
174+
[Obsolete("This constructor is not 64-bit compatible and has been deprecated. Use the constructor that accepts an IntPtr for the event handle instead.")]
175175
public Overlapped(int offsetLo, int offsetHi, int hEvent, IAsyncResult? ar) : this(offsetLo, offsetHi, new IntPtr(hEvent), ar)
176176
{
177177
}
@@ -194,7 +194,7 @@ public int OffsetHigh
194194
set => _overlappedData!.OffsetHigh = value;
195195
}
196196

197-
[Obsolete("This property is not 64-bit compatible. Use EventHandleIntPtr instead. https://go.microsoft.com/fwlink/?linkid=14202")]
197+
[Obsolete("Overlapped.EventHandle is not 64-bit compatible and has been deprecated. Use EventHandleIntPtr instead.")]
198198
public int EventHandle
199199
{
200200
get => EventHandleIntPtr.ToInt32();
@@ -212,7 +212,7 @@ public IntPtr EventHandleIntPtr
212212
* Roots the iocb and stores it in the ReservedCOR field of native Overlapped
213213
* Pins the native Overlapped struct and returns the pinned index.
214214
====================================================================*/
215-
[Obsolete("This method is not safe. Use Pack (iocb, userData) instead. https://go.microsoft.com/fwlink/?linkid=14202")]
215+
[Obsolete("This overload is not safe and has been deprecated. Use Pack(IOCompletionCallback?, object?) instead.")]
216216
[CLSCompliant(false)]
217217
public unsafe NativeOverlapped* Pack(IOCompletionCallback? iocb)
218218
{
@@ -225,7 +225,7 @@ public IntPtr EventHandleIntPtr
225225
return _overlappedData!.Pack(iocb, userData);
226226
}
227227

228-
[Obsolete("This method is not safe. Use UnsafePack (iocb, userData) instead. https://go.microsoft.com/fwlink/?linkid=14202")]
228+
[Obsolete("This overload is not safe and has been deprecated. Use UnsafePack(IOCompletionCallback?, object?) instead.")]
229229
[CLSCompliant(false)]
230230
public unsafe NativeOverlapped* UnsafePack(IOCompletionCallback? iocb)
231231
{

src/coreclr/System.Private.CoreLib/src/System/Threading/ThreadPool.CoreCLR.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ private static extern IntPtr RegisterWaitForSingleObjectNative(
547547
RegisteredWaitHandle registeredWaitHandle
548548
);
549549

550-
[Obsolete("ThreadPool.BindHandle(IntPtr) has been deprecated. Please use ThreadPool.BindHandle(SafeHandle) instead.", false)]
550+
[Obsolete("ThreadPool.BindHandle(IntPtr) has been deprecated. Use ThreadPool.BindHandle(SafeHandle) instead.")]
551551
[SupportedOSPlatform("windows")]
552552
public static bool BindHandle(IntPtr osHandle)
553553
{

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ internal static class Obsoletions
6666
internal const string ReflectionOnlyLoadingMessage = "ReflectionOnly loading is not supported and throws PlatformNotSupportedException.";
6767
internal const string ReflectionOnlyLoadingDiagId = "SYSLIB0018";
6868

69-
internal const string RuntimeEnvironmentMessage = "RuntimeEnvironment members SystemConfigurationFile, GetRuntimeInterfaceAsIntPtr, and GetRuntimeInterfaceAsObject are no longer supported and throw PlatformNotSupportedException.";
69+
internal const string RuntimeEnvironmentMessage = "RuntimeEnvironment members SystemConfigurationFile, GetRuntimeInterfaceAsIntPtr, and GetRuntimeInterfaceAsObject are not supported and throw PlatformNotSupportedException.";
7070
internal const string RuntimeEnvironmentDiagId = "SYSLIB0019";
7171

7272
internal const string JsonSerializerOptionsIgnoreNullValuesMessage = "JsonSerializerOptions.IgnoreNullValues is obsolete. To ignore null values when serializing, set DefaultIgnoreCondition to JsonIgnoreCondition.WhenWritingNull.";
@@ -96,7 +96,7 @@ internal static class Obsoletions
9696
internal const string X509CertificatePrivateKeyMessage = "X509Certificate2.PrivateKey is obsolete. Use the appropriate method to get the private key, such as GetRSAPrivateKey, or use the CopyWithPrivateKey method to create a new instance with a private key.";
9797
internal const string X509CertificatePrivateKeyDiagId = "SYSLIB0028";
9898

99-
internal const string ProduceLegacyHmacValuesMessage = "ProduceLegacyHmacValues is obsolete. Producing legacy HMAC values is no longer supported.";
99+
internal const string ProduceLegacyHmacValuesMessage = "ProduceLegacyHmacValues is obsolete. Producing legacy HMAC values is not supported.";
100100
internal const string ProduceLegacyHmacValuesDiagId = "SYSLIB0029";
101101

102102
internal const string UseManagedSha1Message = "HMACSHA1 always uses the algorithm implementation provided by the platform. Use a constructor without the useManagedSha1 parameter.";

src/libraries/Microsoft.Extensions.DependencyModel/ref/Microsoft.Extensions.DependencyModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
namespace Microsoft.DotNet.PlatformAbstractions
88
{
99
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
10-
[System.ObsoleteAttribute("This type is obsolete and will be removed in a future version. The recommended alternative is System.HashCode.")]
10+
[System.ObsoleteAttribute("HashCodeCombiner has been deprecated. Use System.HashCode instead.")]
1111
public partial struct HashCodeCombiner
1212
{
1313
private int _dummyPrimitive;

src/libraries/Microsoft.Extensions.DependencyModel/src/HashCodeCombiner.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
namespace Microsoft.DotNet.PlatformAbstractions
1010
{
1111
[EditorBrowsable(EditorBrowsableState.Never)]
12-
[Obsolete("This type is obsolete and will be removed in a future version. The recommended alternative is System.HashCode.")]
12+
[Obsolete("HashCodeCombiner has been deprecated. Use System.HashCode instead.")]
1313
public struct HashCodeCombiner
1414
{
1515
private long _combinedHash64;

src/libraries/Microsoft.Extensions.Hosting.Abstractions/ref/Microsoft.Extensions.Hosting.Abstractions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public virtual void Dispose() { }
2323
public virtual System.Threading.Tasks.Task StartAsync(System.Threading.CancellationToken cancellationToken) { throw null; }
2424
public virtual System.Threading.Tasks.Task StopAsync(System.Threading.CancellationToken cancellationToken) { throw null; }
2525
}
26-
[System.ObsoleteAttribute("This type is obsolete and will be removed in a future version. The recommended alternative is Microsoft.Extensions.Hosting.Environments.", false)]
26+
[System.ObsoleteAttribute("EnvironmentName has been deprecated. Use Microsoft.Extensions.Hosting.Environments instead.")]
2727
public static partial class EnvironmentName
2828
{
2929
public static readonly string Development;
@@ -77,7 +77,7 @@ public static partial class HostingEnvironmentExtensions
7777
public static bool IsProduction(this Microsoft.Extensions.Hosting.IHostingEnvironment hostingEnvironment) { throw null; }
7878
public static bool IsStaging(this Microsoft.Extensions.Hosting.IHostingEnvironment hostingEnvironment) { throw null; }
7979
}
80-
[System.ObsoleteAttribute("This type is obsolete and will be removed in a future version. The recommended alternative is Microsoft.Extensions.Hosting.IHostApplicationLifetime.", false)]
80+
[System.ObsoleteAttribute("IApplicationLifetime has been deprecated. Use Microsoft.Extensions.Hosting.IHostApplicationLifetime instead.")]
8181
public partial interface IApplicationLifetime
8282
{
8383
System.Threading.CancellationToken ApplicationStarted { get; }
@@ -121,7 +121,7 @@ public partial interface IHostEnvironment
121121
string ContentRootPath { get; set; }
122122
string EnvironmentName { get; set; }
123123
}
124-
[System.ObsoleteAttribute("This type is obsolete and will be removed in a future version. The recommended alternative is Microsoft.Extensions.Hosting.IHostEnvironment.", false)]
124+
[System.ObsoleteAttribute("IHostingEnvironment has been deprecated. Use Microsoft.Extensions.Hosting.IHostEnvironment instead.")]
125125
public partial interface IHostingEnvironment
126126
{
127127
string ApplicationName { get; set; }

src/libraries/Microsoft.Extensions.Hosting.Abstractions/src/EnvironmentName.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace Microsoft.Extensions.Hosting
1010
/// The recommended alternative is Microsoft.Extensions.Hosting.Environments.
1111
/// </para>
1212
/// </summary>
13-
[System.Obsolete("This type is obsolete and will be removed in a future version. The recommended alternative is Microsoft.Extensions.Hosting.Environments.", error: false)]
13+
[System.Obsolete("EnvironmentName has been deprecated. Use Microsoft.Extensions.Hosting.Environments instead.")]
1414
public static class EnvironmentName
1515
{
1616
public static readonly string Development = "Development";

src/libraries/Microsoft.Extensions.Hosting.Abstractions/src/IApplicationLifetime.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace Microsoft.Extensions.Hosting
1313
/// The recommended alternative is Microsoft.Extensions.Hosting.IHostApplicationLifetime.
1414
/// </para>
1515
/// </summary>
16-
[Obsolete("This type is obsolete and will be removed in a future version. The recommended alternative is Microsoft.Extensions.Hosting.IHostApplicationLifetime.", error: false)]
16+
[Obsolete("IApplicationLifetime has been deprecated. Use Microsoft.Extensions.Hosting.IHostApplicationLifetime instead.")]
1717
public interface IApplicationLifetime
1818
{
1919
/// <summary>

0 commit comments

Comments
 (0)
0