Skip to content

Commit

Permalink
Use friendly obsolete messages #1148
Browse files Browse the repository at this point in the history
  • Loading branch information
Tratcher committed Feb 21, 2019
1 parent 924015e commit d11f926
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public virtual void Dispose() { }
[System.Diagnostics.DebuggerStepThroughAttribute]
public virtual System.Threading.Tasks.Task StopAsync(System.Threading.CancellationToken cancellationToken) { throw null; }
}
[System.ObsoleteAttribute("Use Environments instead.", false)]
[System.ObsoleteAttribute("This type is obsolete and will be removed in a future version. The recommended alternative is Microsoft.Extensions.Hosting.Environments.", false)]
public static partial class EnvironmentName
{
public static readonly string Development;
Expand Down Expand Up @@ -76,7 +76,7 @@ public static partial class HostingEnvironmentExtensions
public static bool IsProduction(this Microsoft.Extensions.Hosting.IHostingEnvironment hostingEnvironment) { throw null; }
public static bool IsStaging(this Microsoft.Extensions.Hosting.IHostingEnvironment hostingEnvironment) { throw null; }
}
[System.ObsoleteAttribute("Use IHostApplicationLifetime instead.", false)]
[System.ObsoleteAttribute("This type is obsolete and will be removed in a future version. The recommended alternative is Microsoft.Extensions.Hosting.IHostApplicationLifetime.", false)]
public partial interface IApplicationLifetime
{
System.Threading.CancellationToken ApplicationStarted { get; }
Expand Down Expand Up @@ -120,7 +120,7 @@ public partial interface IHostEnvironment
string ContentRootPath { get; set; }
string EnvironmentName { get; set; }
}
[System.ObsoleteAttribute("Use IHostEnvironment instead.", false)]
[System.ObsoleteAttribute("This type is obsolete and will be removed in a future version. The recommended alternative is Microsoft.Extensions.Hosting.IHostEnvironment.", false)]
public partial interface IHostingEnvironment
{
string ApplicationName { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public virtual void Dispose() { }
[System.Diagnostics.DebuggerStepThroughAttribute]
public virtual System.Threading.Tasks.Task StopAsync(System.Threading.CancellationToken cancellationToken) { throw null; }
}
[System.ObsoleteAttribute("Use Environments instead.", false)]
[System.ObsoleteAttribute("This type is obsolete and will be removed in a future version. The recommended alternative is Microsoft.Extensions.Hosting.Environments.", false)]
public static partial class EnvironmentName
{
public static readonly string Development;
Expand Down Expand Up @@ -76,7 +76,7 @@ public static partial class HostingEnvironmentExtensions
public static bool IsProduction(this Microsoft.Extensions.Hosting.IHostingEnvironment hostingEnvironment) { throw null; }
public static bool IsStaging(this Microsoft.Extensions.Hosting.IHostingEnvironment hostingEnvironment) { throw null; }
}
[System.ObsoleteAttribute("Use IHostApplicationLifetime instead.", false)]
[System.ObsoleteAttribute("This type is obsolete and will be removed in a future version. The recommended alternative is Microsoft.Extensions.Hosting.IHostApplicationLifetime.", false)]
public partial interface IApplicationLifetime
{
System.Threading.CancellationToken ApplicationStarted { get; }
Expand Down Expand Up @@ -120,7 +120,7 @@ public partial interface IHostEnvironment
string ContentRootPath { get; set; }
string EnvironmentName { get; set; }
}
[System.ObsoleteAttribute("Use IHostEnvironment instead.", false)]
[System.ObsoleteAttribute("This type is obsolete and will be removed in a future version. The recommended alternative is Microsoft.Extensions.Hosting.IHostEnvironment.", false)]
public partial interface IHostingEnvironment
{
string ApplicationName { get; set; }
Expand Down
6 changes: 5 additions & 1 deletion src/Hosting/Abstractions/src/EnvironmentName.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ namespace Microsoft.Extensions.Hosting
{
/// <summary>
/// Commonly used environment names.
/// <para>
/// This type is obsolete and will be removed in a future version.
/// The recommended alternative is Microsoft.Extensions.Hosting.Environments.
/// </para>
/// </summary>
[System.Obsolete("Use Environments instead.", error: false)]
[System.Obsolete("This type is obsolete and will be removed in a future version. The recommended alternative is Microsoft.Extensions.Hosting.Environments.", error: false)]
public static class EnvironmentName
{
public static readonly string Development = "Development";
Expand Down
6 changes: 5 additions & 1 deletion src/Hosting/Abstractions/src/IApplicationLifetime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ namespace Microsoft.Extensions.Hosting
{
/// <summary>
/// Allows consumers to perform cleanup during a graceful shutdown.
/// <para>
/// This type is obsolete and will be removed in a future version.
/// The recommended alternative is Microsoft.Extensions.Hosting.IHostApplicationLifetime.
/// </para>
/// </summary>
[Obsolete("Use IHostApplicationLifetime instead.", error: false)]
[Obsolete("This type is obsolete and will be removed in a future version. The recommended alternative is Microsoft.Extensions.Hosting.IHostApplicationLifetime.", error: false)]
public interface IApplicationLifetime
{
/// <summary>
Expand Down
6 changes: 5 additions & 1 deletion src/Hosting/Abstractions/src/IHostingEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ namespace Microsoft.Extensions.Hosting
{
/// <summary>
/// Provides information about the hosting environment an application is running in.
/// <para>
/// This type is obsolete and will be removed in a future version.
/// The recommended alternative is Microsoft.Extensions.Hosting.IHostEnvironment.
/// </para>
/// </summary>
[Obsolete("Use IHostEnvironment instead.", error: false)]
[Obsolete("This type is obsolete and will be removed in a future version. The recommended alternative is Microsoft.Extensions.Hosting.IHostEnvironment.", error: false)]
public interface IHostingEnvironment
{
/// <summary>
Expand Down

0 comments on commit d11f926

Please sign in to comment.