diff --git a/src/Platform/Microsoft.Testing.Platform/Builder/TestApplication.cs b/src/Platform/Microsoft.Testing.Platform/Builder/TestApplication.cs index 4ee303edd6..9ef8ff3d62 100644 --- a/src/Platform/Microsoft.Testing.Platform/Builder/TestApplication.cs +++ b/src/Platform/Microsoft.Testing.Platform/Builder/TestApplication.cs @@ -15,11 +15,6 @@ namespace Microsoft.Testing.Platform.Builder; /// Represents a test application. /// public sealed class TestApplication : ITestApplication -#if NETCOREAPP -#pragma warning disable SA1001 // Commas should be spaced correctly - , IAsyncDisposable -#pragma warning restore SA1001 // Commas should be spaced correctly -#endif { private readonly IHost _host; private static UnhandledExceptionHandler? s_unhandledExceptionHandler; @@ -41,6 +36,7 @@ static TestApplication() => /// The command line arguments. /// The test application options. /// The task representing the asynchronous operation. + [Obsolete("This method is obsolete. Use CreateBuilderAsync instead.")] public static Task CreateServerModeBuilderAsync(string[] args, TestApplicationOptions? testApplicationOptions = null) { if (args.Contains($"--{PlatformCommandLineProvider.ServerOptionKey}") || args.Contains($"-{PlatformCommandLineProvider.ServerOptionKey}")) @@ -214,14 +210,6 @@ async Task LogVariableAsync(string key) public void Dispose() => (_host as IDisposable)?.Dispose(); -#if NETCOREAPP - /// - public ValueTask DisposeAsync() - => _host is IAsyncDisposable asyncDisposable - ? asyncDisposable.DisposeAsync() - : ValueTask.CompletedTask; -#endif - /// public async Task RunAsync() => await _host.RunAsync().ConfigureAwait(false); diff --git a/src/Platform/Microsoft.Testing.Platform/PublicAPI/net/PublicAPI.Unshipped.txt b/src/Platform/Microsoft.Testing.Platform/PublicAPI/net/PublicAPI.Unshipped.txt index 7dc5c58110..dccec90292 100644 --- a/src/Platform/Microsoft.Testing.Platform/PublicAPI/net/PublicAPI.Unshipped.txt +++ b/src/Platform/Microsoft.Testing.Platform/PublicAPI/net/PublicAPI.Unshipped.txt @@ -1 +1,2 @@ #nullable enable +*REMOVED*Microsoft.Testing.Platform.Builder.TestApplication.DisposeAsync() -> System.Threading.Tasks.ValueTask