From 5f890b67e7d2d6d1a8d8e757462028f8c1765c8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amaury=20Lev=C3=A9?= Date: Tue, 2 Aug 2022 12:13:31 +0200 Subject: [PATCH 1/2] Replace netstandard1.0 and netstandard1.3 with netstandard2.0 --- scripts/build.ps1 | 21 +- scripts/build.sh | 2 +- .../Helpers/ReflectionHelpers.MethodBase.cs | 8 +- .../Helpers/ReflectionHelpers.Type.cs | 4 +- .../InvalidManagedNameException.cs | 8 +- .../ManagedNameHelper.Reflection.cs | 6 +- ...osoft.TestPlatform.AdapterUtilities.csproj | 6 +- .../Microsoft.TestPlatform.Common.csproj | 2 +- .../netstandard1.3/PublicAPI.Shipped.txt | 1 - .../netstandard1.3/PublicAPI.Unshipped.txt | 1 - .../Utilities/MetadataReaderHelper.cs | 4 - .../Utilities/SimpleJSON.cs | 6 +- ...TestPlatform.CommunicationUtilities.csproj | 2 +- .../netstandard1.3/PublicAPI.Shipped.txt | 1 - .../netstandard1.3/PublicAPI.Unshipped.txt | 1 - .../Serialization/TestObjectConverter.cs | 2 - .../SocketClient.cs | 5 - .../SocketCommunicationManager.cs | 5 - .../SocketServer.cs | 5 - .../FeatureFlag/FeatureFlag.cs | 4 - .../Helpers/DotnetHostHelper.cs | 4 - .../Helpers/EnvironmentHelper.cs | 7 - .../Helpers/EnvironmentVariableHelper.cs | 4 - .../Helpers/FileHelper.cs | 4 - .../Helpers/Interfaces/IFileHelper.cs | 8 - .../Interfaces/IWindowsRegistryHelper.cs | 4 - .../Helpers/WindowsRegistryHelper.cs | 4 - ...icrosoft.TestPlatform.CoreUtilities.csproj | 15 +- .../Output/ConsoleOutput.cs | 2 +- .../Output/OutputExtensions.cs | 2 +- .../Properties/AssemblyInfo.cs | 2 - .../netstandard1.0/PublicAPI.Shipped.txt | 3 - .../netstandard1.0/PublicAPI.Unshipped.txt | 1 - .../netstandard1.3/PublicAPI.Shipped.txt | 13 -- .../netstandard1.3/PublicAPI.Unshipped.txt | 1 - .../Tracing/EqtTrace.cs | 6 - .../Tracing/TestPlatformEventSource.cs | 4 - .../Adapter/FrameworkHandle.cs | 4 +- ...rosoft.TestPlatform.CrossPlatEngine.csproj | 5 +- .../netstandard1.3/PublicAPI.Shipped.txt | 1 - .../netstandard1.3/PublicAPI.Unshipped.txt | 1 - .../UILanguageOverride.cs | 5 +- .../Constants.cs | 7 +- .../Framework.cs | 28 +-- .../Logger/LoggerRunSettings.cs | 2 - .../Logger/LoggerSettings.cs | 10 - .../Microsoft.TestPlatform.ObjectModel.csproj | 39 +--- .../Navigation/PortableSymbolReader.cs | 2 +- .../Properties/AssemblyInfo.cs | 2 - .../netstandard1.0/PublicAPI.Shipped.txt | 4 - .../netstandard1.0/PublicAPI.Unshipped.txt | 1 - .../netstandard1.3/PublicAPI.Shipped.txt | 4 - .../netstandard1.3/PublicAPI.Unshipped.txt | 1 - .../RunSettings/RunConfiguration.cs | 16 +- .../RunSettings/TestRunSettings.cs | 4 - .../TestProperty/TestProperty.cs | 23 +-- .../TestServiceLocator.cs | 5 - .../Utilities/Sha1Helper.cs | 8 - .../Utilities/XmlRunSettingsUtilities.cs | 13 +- ...t.TestPlatform.PlatformAbstractions.csproj | 9 +- .../netstandard1.0/PublicAPI.Shipped.txt | 7 - .../netstandard1.0/PublicAPI.Unshipped.txt | 1 - .../netstandard1.3/PublicAPI.Shipped.txt | 7 - .../netstandard1.3/PublicAPI.Unshipped.txt | 1 - .../common/NativeMethods.cs | 4 - .../common/System/ProcessHelper.cs | 2 - .../netstandard/IO/PlatformStream.cs | 23 --- .../Runtime/PlatformAssemblyExtensions.cs | 19 -- .../Runtime/PlatformAssemblyLoadContext.cs | 28 --- .../Runtime/PlatformAssemblyResolver.cs | 40 ---- .../netstandard/System/PlatformEnvironment.cs | 58 ------ .../netstandard/System/PlatformThread.cs | 22 --- .../netstandard/System/ProcessHelper.cs | 112 ----------- .../netstandard/Tracing/PlatformEqtTrace.cs | 83 -------- .../InferRunSettingsHelper.cs | 5 - .../Microsoft.TestPlatform.Utilities.csproj | 2 +- .../netstandard1.3/PublicAPI.Shipped.txt | 1 - .../netstandard1.3/PublicAPI.Unshipped.txt | 1 - .../nuspec/Microsoft.CodeCoverage.nuspec | 96 ++++----- ...osoft.TestPlatform.AdapterUtilities.nuspec | 14 -- .../TestPlatform.Extensions.TrxLogger.nuspec | 35 ++-- .../nuspec/TestPlatform.Internal.Uwp.nuspec | 184 +++++++++--------- .../nuspec/TestPlatform.ObjectModel.nuspec | 91 --------- src/package/sign/sign.proj | 43 ---- 84 files changed, 215 insertions(+), 1036 deletions(-) delete mode 100644 src/Microsoft.TestPlatform.Common/PublicAPI/netstandard1.3/PublicAPI.Shipped.txt delete mode 100644 src/Microsoft.TestPlatform.Common/PublicAPI/netstandard1.3/PublicAPI.Unshipped.txt delete mode 100644 src/Microsoft.TestPlatform.CommunicationUtilities/PublicAPI/netstandard1.3/PublicAPI.Shipped.txt delete mode 100644 src/Microsoft.TestPlatform.CommunicationUtilities/PublicAPI/netstandard1.3/PublicAPI.Unshipped.txt delete mode 100644 src/Microsoft.TestPlatform.CoreUtilities/PublicAPI/netstandard1.0/PublicAPI.Shipped.txt delete mode 100644 src/Microsoft.TestPlatform.CoreUtilities/PublicAPI/netstandard1.0/PublicAPI.Unshipped.txt delete mode 100644 src/Microsoft.TestPlatform.CoreUtilities/PublicAPI/netstandard1.3/PublicAPI.Shipped.txt delete mode 100644 src/Microsoft.TestPlatform.CoreUtilities/PublicAPI/netstandard1.3/PublicAPI.Unshipped.txt delete mode 100644 src/Microsoft.TestPlatform.CrossPlatEngine/PublicAPI/netstandard1.3/PublicAPI.Shipped.txt delete mode 100644 src/Microsoft.TestPlatform.CrossPlatEngine/PublicAPI/netstandard1.3/PublicAPI.Unshipped.txt delete mode 100644 src/Microsoft.TestPlatform.ObjectModel/PublicAPI/netstandard1.0/PublicAPI.Shipped.txt delete mode 100644 src/Microsoft.TestPlatform.ObjectModel/PublicAPI/netstandard1.0/PublicAPI.Unshipped.txt delete mode 100644 src/Microsoft.TestPlatform.ObjectModel/PublicAPI/netstandard1.3/PublicAPI.Shipped.txt delete mode 100644 src/Microsoft.TestPlatform.ObjectModel/PublicAPI/netstandard1.3/PublicAPI.Unshipped.txt delete mode 100644 src/Microsoft.TestPlatform.PlatformAbstractions/PublicAPI/netstandard1.0/PublicAPI.Shipped.txt delete mode 100644 src/Microsoft.TestPlatform.PlatformAbstractions/PublicAPI/netstandard1.0/PublicAPI.Unshipped.txt delete mode 100644 src/Microsoft.TestPlatform.PlatformAbstractions/PublicAPI/netstandard1.3/PublicAPI.Shipped.txt delete mode 100644 src/Microsoft.TestPlatform.PlatformAbstractions/PublicAPI/netstandard1.3/PublicAPI.Unshipped.txt delete mode 100644 src/Microsoft.TestPlatform.PlatformAbstractions/netstandard/IO/PlatformStream.cs delete mode 100644 src/Microsoft.TestPlatform.PlatformAbstractions/netstandard/Runtime/PlatformAssemblyExtensions.cs delete mode 100644 src/Microsoft.TestPlatform.PlatformAbstractions/netstandard/Runtime/PlatformAssemblyLoadContext.cs delete mode 100644 src/Microsoft.TestPlatform.PlatformAbstractions/netstandard/Runtime/PlatformAssemblyResolver.cs delete mode 100644 src/Microsoft.TestPlatform.PlatformAbstractions/netstandard/System/PlatformEnvironment.cs delete mode 100644 src/Microsoft.TestPlatform.PlatformAbstractions/netstandard/System/PlatformThread.cs delete mode 100644 src/Microsoft.TestPlatform.PlatformAbstractions/netstandard/System/ProcessHelper.cs delete mode 100644 src/Microsoft.TestPlatform.PlatformAbstractions/netstandard/Tracing/PlatformEqtTrace.cs delete mode 100644 src/Microsoft.TestPlatform.Utilities/PublicAPI/netstandard1.3/PublicAPI.Shipped.txt delete mode 100644 src/Microsoft.TestPlatform.Utilities/PublicAPI/netstandard1.3/PublicAPI.Unshipped.txt diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 4bffd35f77..97576cc23f 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -84,8 +84,6 @@ $TPB_TargetFramework472 = "net472" $TPB_TargetFramework48 = "net48" $TPB_TargetFrameworkCore31 = "netcoreapp3.1" $TPB_TargetFrameworkUap100 = "uap10.0" -$TPB_TargetFrameworkNS10 = "netstandard1.0" -$TPB_TargetFrameworkNS13 = "netstandard1.3" $TPB_TargetFrameworkNS20 = "netstandard2.0" $TPB_Configuration = $Configuration $TPB_TargetRuntime = $TargetRuntime @@ -422,8 +420,6 @@ function Publish-Package { Write-Log "Publish-Package: Started." $net462PackageDir = Get-FullCLR462PackageDirectory $uap100PackageDir = $(Join-Path $env:TP_OUT_DIR "$TPB_Configuration\$TPB_TargetFrameworkUap100"); - $netstandard10PackageDir = $(Join-Path $env:TP_OUT_DIR "$TPB_Configuration\$TPB_TargetFrameworkNS10"); - $netstandard13PackageDir = $(Join-Path $env:TP_OUT_DIR "$TPB_Configuration\$TPB_TargetFrameworkNS13"); $netstandard20PackageDir = $(Join-Path $env:TP_OUT_DIR "$TPB_Configuration\$TPB_TargetFrameworkNS20"); $coreCLR31PackageDir = Get-CoreCLR31PackageDirectory $coreClrNetFrameworkTestHostDir = Join-Path $coreCLR31PackageDir "TestHostNetFramework" @@ -535,8 +531,6 @@ function Publish-Package { -files @{ $TPB_TargetFramework462 = $net462PackageDir # net462 $TPB_TargetFrameworkCore31 = $coreCLR31PackageDir # netcoreapp3.1 - $TPB_TargetFrameworkNS10 = $netstandard10PackageDir # netstandard1_0 - $TPB_TargetFrameworkNS13 = $netstandard13PackageDir # netstandard1_3 $TPB_TargetFrameworkNS20 = $netstandard20PackageDir # netstandard2_0 $TPB_TargetFrameworkUap100 = $uap100PackageDir # uap10.0 } @@ -552,8 +546,6 @@ function Publish-Package { -files @{ $TPB_TargetFramework462 = $net462PackageDir # net462 $TPB_TargetFrameworkCore31 = $coreCLR31PackageDir # netcoreapp3.1 - $TPB_TargetFrameworkNS10 = $netstandard10PackageDir # netstandard1_0 - $TPB_TargetFrameworkNS13 = $netstandard13PackageDir # netstandard1_3 $TPB_TargetFrameworkNS20 = $netstandard20PackageDir # netstandard2_0 $TPB_TargetFrameworkUap100 = $uap100PackageDir # uap10.0 } @@ -567,8 +559,6 @@ function Publish-Package { Copy-Bulk -root (Join-Path $env:TP_ROOT_DIR "src\Microsoft.TestPlatform.CoreUtilities\bin\$TPB_Configuration") ` -files @{ $TPB_TargetFramework462 = $net462PackageDir # net462 - $TPB_TargetFrameworkNS10 = $netstandard10PackageDir # netstandard1_0 - $TPB_TargetFrameworkNS13 = $netstandard13PackageDir # netstandard1_3 $TPB_TargetFrameworkNS20 = $netstandard20PackageDir # netstandard2_0 $TPB_TargetFrameworkUap100 = $uap100PackageDir # uap10.0 } @@ -583,7 +573,6 @@ function Publish-Package { Copy-Bulk -root (Join-Path $env:TP_ROOT_DIR "src\Microsoft.TestPlatform.AdapterUtilities\bin\$TPB_Configuration") ` -files @{ "$TPB_TargetFramework462/any" = $net462PackageDir # net462 - $TPB_TargetFrameworkNS10 = $netstandard10PackageDir # netstandard1_0 $TPB_TargetFrameworkNS20 = $netstandard20PackageDir # netstandard2_0 $TPB_TargetFrameworkUap100 = $uap100PackageDir # uap10.0 } @@ -592,7 +581,7 @@ function Publish-Package { # Publish Microsoft.TestPlatform.CrossPlatEngine Copy-Bulk -root (Join-Path $env:TP_ROOT_DIR "src\Microsoft.TestPlatform.CrossPlatEngine\bin\$TPB_Configuration") ` -files @{ - $TPB_TargetFrameworkNS13 = $netstandard13PackageDir # netstandard1_3 + $TPB_TargetFrameworkNS20 = $netstandard20PackageDir # netstandard2_0 } ################################################################################ @@ -728,7 +717,7 @@ function Publish-Package { Write-Verbose "Copy-Item $newtonsoft $net462PackageDir -Force" Copy-Item $newtonsoft $net462PackageDir -Force - $newtonsoft = Join-Path $env:TP_PACKAGES_DIR "newtonsoft.json\$newtonsoftJsonVersion\lib\netstandard1.0\Newtonsoft.Json.dll" + $newtonsoft = Join-Path $env:TP_PACKAGES_DIR "newtonsoft.json\$newtonsoftJsonVersion\lib\netstandard2.0\Newtonsoft.Json.dll" Write-Verbose "Copy-Item $newtonsoft $coreCLR31PackageDir -Force" Copy-Item $newtonsoft $coreCLR31PackageDir -Force @@ -1063,7 +1052,7 @@ function Create-NugetPackages { $uap10Nuget = $testhostUapPackageDir } - Invoke-Exe $nugetExe -Arguments "pack $stagingDir\$file -OutputDirectory $packageOutputDir -Version $TPB_Version -Properties Version=$TPB_Version;JsonNetVersion=$JsonNetVersion;Runtime=$TPB_TargetRuntime;NetCoreTargetFramework=$TPB_TargetFrameworkCore31;FakesPackageDir=$FakesPackageDir;NetStandard10Framework=$TPB_TargetFrameworkNS10;NetStandard13Framework=$TPB_TargetFrameworkNS13;NetStandard20Framework=$TPB_TargetFrameworkNS20;Uap10Framework=$uap10Nuget;BranchName=$TPB_BRANCH;CommitId=$TPB_COMMIT $additionalArgs" + Invoke-Exe $nugetExe -Arguments "pack $stagingDir\$file -OutputDirectory $packageOutputDir -Version $TPB_Version -Properties Version=$TPB_Version;JsonNetVersion=$JsonNetVersion;Runtime=$TPB_TargetRuntime;NetCoreTargetFramework=$TPB_TargetFrameworkCore31;FakesPackageDir=$FakesPackageDir;NetStandard20Framework=$TPB_TargetFrameworkNS20;Uap10Framework=$uap10Nuget;BranchName=$TPB_BRANCH;CommitId=$TPB_COMMIT $additionalArgs" } foreach ($file in $projectFiles) { @@ -1273,10 +1262,8 @@ function Build-SpecificProjects { # FrameworksAndOutDirs format ("", ""). $FrameworksAndOutDirs = ( ("net462", "net462\win7-x64"), - ("netstandard1.0", "netstandard1.0"), - ("netstandard1.3", "netstandard1.3"), # REVIEW ME: Why do we copy netstandard2.0 into netcorecorapp2.1? - ("netstandard2.0", "netcoreapp2.1"), + ("netstandard2.0", "netstandard2.0"), ("netcoreapp3.1", "netcoreapp3.1") ) diff --git a/scripts/build.sh b/scripts/build.sh index 066a6eef0f..ea8f8e28ec 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -440,7 +440,7 @@ function publish_package() done #*************************************************************************************************************# - newtonsoft=$TP_PACKAGES_DIR/newtonsoft.json/$TPB_NEWTONSOFT_JSON_VERSION/lib/netstandard1.0/Newtonsoft.Json.dll + newtonsoft=$TP_PACKAGES_DIR/newtonsoft.json/$TPB_NEWTONSOFT_JSON_VERSION/lib/netstandard2.0/Newtonsoft.Json.dll cp $newtonsoft $packageDir done diff --git a/src/Microsoft.TestPlatform.AdapterUtilities/Helpers/ReflectionHelpers.MethodBase.cs b/src/Microsoft.TestPlatform.AdapterUtilities/Helpers/ReflectionHelpers.MethodBase.cs index 74f62f35e8..b4098b11f2 100644 --- a/src/Microsoft.TestPlatform.AdapterUtilities/Helpers/ReflectionHelpers.MethodBase.cs +++ b/src/Microsoft.TestPlatform.AdapterUtilities/Helpers/ReflectionHelpers.MethodBase.cs @@ -8,7 +8,7 @@ namespace Microsoft.TestPlatform.AdapterUtilities.Helpers; internal static partial class ReflectionHelpers { -#if NETSTANDARD1_0 || NETSTANDARD1_3 || WINDOWS_UWP +#if WINDOWS_UWP private static readonly Type MethodBase = typeof(MethodBase); private const string MemberTypePropertyName = "MemberType"; @@ -22,7 +22,7 @@ internal static partial class ReflectionHelpers internal static bool IsMethod(MethodBase method) { -#if !NETSTANDARD1_0 && !NETSTANDARD1_3 && !WINDOWS_UWP +#if !WINDOWS_UWP return method.MemberType == MemberTypes.Method; #else AssertSupport(MemberTypeProperty, MemberTypePropertyName, MethodBase.FullName); @@ -33,7 +33,7 @@ internal static bool IsMethod(MethodBase method) internal static Type? GetReflectedType(MethodBase method) { -#if !NETSTANDARD1_0 && !NETSTANDARD1_3 && !WINDOWS_UWP +#if !WINDOWS_UWP return method.ReflectedType; #else AssertSupport(MemberTypeProperty, ReflectedTypePropertyName, MethodBase.FullName); @@ -44,7 +44,7 @@ internal static bool IsMethod(MethodBase method) internal static RuntimeMethodHandle GetMethodHandle(MethodBase method) { -#if !NETSTANDARD1_0 && !NETSTANDARD1_3 && !WINDOWS_UWP +#if !WINDOWS_UWP return method.MethodHandle; #else AssertSupport(MemberTypeProperty, MethodHandlePropertyName, MethodBase.FullName); diff --git a/src/Microsoft.TestPlatform.AdapterUtilities/Helpers/ReflectionHelpers.Type.cs b/src/Microsoft.TestPlatform.AdapterUtilities/Helpers/ReflectionHelpers.Type.cs index 63e50db279..17e0ea5330 100644 --- a/src/Microsoft.TestPlatform.AdapterUtilities/Helpers/ReflectionHelpers.Type.cs +++ b/src/Microsoft.TestPlatform.AdapterUtilities/Helpers/ReflectionHelpers.Type.cs @@ -10,7 +10,7 @@ internal static partial class ReflectionHelpers { internal static bool IsGenericType(Type type) { -#if !NETSTANDARD1_0 && !NETSTANDARD1_3 && !WINDOWS_UWP +#if !WINDOWS_UWP return type.IsGenericType; #else return type.GetTypeInfo().IsGenericType; @@ -19,7 +19,7 @@ internal static bool IsGenericType(Type type) internal static MethodBase? GetDeclaringMethod(Type type) { -#if !NETSTANDARD1_0 && !NETSTANDARD1_3 && !WINDOWS_UWP +#if !WINDOWS_UWP return type.DeclaringMethod; #else return type.GetTypeInfo().DeclaringMethod; diff --git a/src/Microsoft.TestPlatform.AdapterUtilities/ManagedNameUtilities/InvalidManagedNameException.cs b/src/Microsoft.TestPlatform.AdapterUtilities/ManagedNameUtilities/InvalidManagedNameException.cs index 9644722969..a06e7ab539 100644 --- a/src/Microsoft.TestPlatform.AdapterUtilities/ManagedNameUtilities/InvalidManagedNameException.cs +++ b/src/Microsoft.TestPlatform.AdapterUtilities/ManagedNameUtilities/InvalidManagedNameException.cs @@ -3,24 +3,24 @@ using System; -#if !NETSTANDARD1_0 && !WINDOWS_UWP +#if !WINDOWS_UWP using System.Runtime.Serialization; #endif namespace Microsoft.TestPlatform.AdapterUtilities.ManagedNameUtilities; -#if !NETSTANDARD1_0 && !WINDOWS_UWP +#if !WINDOWS_UWP [Serializable] #endif public class InvalidManagedNameException : Exception -#if !NETSTANDARD1_0 && !WINDOWS_UWP +#if !WINDOWS_UWP , ISerializable #endif { public InvalidManagedNameException(string? message) : base(message) { } -#if !NETSTANDARD1_0 && !WINDOWS_UWP +#if !WINDOWS_UWP protected InvalidManagedNameException(SerializationInfo info, StreamingContext context) : base(info, context) { } #endif } diff --git a/src/Microsoft.TestPlatform.AdapterUtilities/ManagedNameUtilities/ManagedNameHelper.Reflection.cs b/src/Microsoft.TestPlatform.AdapterUtilities/ManagedNameUtilities/ManagedNameHelper.Reflection.cs index 078aea9b6a..2445ffeda5 100644 --- a/src/Microsoft.TestPlatform.AdapterUtilities/ManagedNameUtilities/ManagedNameHelper.Reflection.cs +++ b/src/Microsoft.TestPlatform.AdapterUtilities/ManagedNameUtilities/ManagedNameHelper.Reflection.cs @@ -228,7 +228,7 @@ public static MethodBase GetMethod(Assembly assembly, string managedTypeName, st var parsedManagedTypeName = ReflectionHelpers.ParseEscapedString(managedTypeName); -#if !NETSTANDARD1_0 && !NETSTANDARD1_3 && !WINDOWS_UWP +#if !WINDOWS_UWP type = assembly.GetType(parsedManagedTypeName, throwOnError: false, ignoreCase: false); #else try @@ -297,7 +297,7 @@ bool Filter(MemberInfo mbr, object? param) MemberInfo[] methods; -#if !NETSTANDARD1_0 && !NETSTANDARD1_3 && !WINDOWS_UWP +#if !WINDOWS_UWP var bindingFlags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static; methods = type.FindMembers(MemberTypes.Method, bindingFlags, Filter, null); #else @@ -511,7 +511,7 @@ private static void AppendGenericTypeParameters(StringBuilder b, Type type) { Type[] genericArguments; -#if !NETSTANDARD1_0 && !NETSTANDARD1_3 && !WINDOWS_UWP +#if !WINDOWS_UWP genericArguments = type.GetGenericArguments(); #else genericArguments = type.GetTypeInfo().GenericTypeArguments; diff --git a/src/Microsoft.TestPlatform.AdapterUtilities/Microsoft.TestPlatform.AdapterUtilities.csproj b/src/Microsoft.TestPlatform.AdapterUtilities/Microsoft.TestPlatform.AdapterUtilities.csproj index ed46d7cd29..f3256d8c86 100644 --- a/src/Microsoft.TestPlatform.AdapterUtilities/Microsoft.TestPlatform.AdapterUtilities.csproj +++ b/src/Microsoft.TestPlatform.AdapterUtilities/Microsoft.TestPlatform.AdapterUtilities.csproj @@ -5,7 +5,7 @@ - netstandard1.0;netstandard2.0;$(TargetNetFxVersion) + netstandard2.0;$(TargetNetFxVersion) $(TargetFrameworks);uap10.0 net6.0 Microsoft.TestPlatform.AdapterUtilities @@ -72,8 +72,8 @@ - - + + diff --git a/src/Microsoft.TestPlatform.Common/Microsoft.TestPlatform.Common.csproj b/src/Microsoft.TestPlatform.Common/Microsoft.TestPlatform.Common.csproj index 1657dcba1c..418848e7d8 100644 --- a/src/Microsoft.TestPlatform.Common/Microsoft.TestPlatform.Common.csproj +++ b/src/Microsoft.TestPlatform.Common/Microsoft.TestPlatform.Common.csproj @@ -6,7 +6,7 @@ Microsoft.VisualStudio.TestPlatform.Common - net6.0;netstandard2.0;netstandard1.3;$(TargetNetFxVersion) + net6.0;netstandard2.0;$(TargetNetFxVersion) net6.0 false true diff --git a/src/Microsoft.TestPlatform.Common/PublicAPI/netstandard1.3/PublicAPI.Shipped.txt b/src/Microsoft.TestPlatform.Common/PublicAPI/netstandard1.3/PublicAPI.Shipped.txt deleted file mode 100644 index 7dc5c58110..0000000000 --- a/src/Microsoft.TestPlatform.Common/PublicAPI/netstandard1.3/PublicAPI.Shipped.txt +++ /dev/null @@ -1 +0,0 @@ -#nullable enable diff --git a/src/Microsoft.TestPlatform.Common/PublicAPI/netstandard1.3/PublicAPI.Unshipped.txt b/src/Microsoft.TestPlatform.Common/PublicAPI/netstandard1.3/PublicAPI.Unshipped.txt deleted file mode 100644 index 7dc5c58110..0000000000 --- a/src/Microsoft.TestPlatform.Common/PublicAPI/netstandard1.3/PublicAPI.Unshipped.txt +++ /dev/null @@ -1 +0,0 @@ -#nullable enable diff --git a/src/Microsoft.TestPlatform.Common/Utilities/MetadataReaderHelper.cs b/src/Microsoft.TestPlatform.Common/Utilities/MetadataReaderHelper.cs index e9157911d9..e515ab5950 100644 --- a/src/Microsoft.TestPlatform.Common/Utilities/MetadataReaderHelper.cs +++ b/src/Microsoft.TestPlatform.Common/Utilities/MetadataReaderHelper.cs @@ -51,7 +51,6 @@ private static Type[] DiscoverTestExtensionTypesV2AttributeInternal(Assembly loa { EqtTrace.Verbose($"MetadataReaderExtensionsHelper: Discovering extensions inside assembly '{loadedAssembly.FullName}' file path '{assemblyFilePath}'"); -#if !NETSTANDARD1_3 // We don't cache the load because this method is used by DiscoverTestExtensionTypesV2Attribute that caches the outcome Type[] Assembly assemblyToAnalyze; try @@ -63,9 +62,6 @@ private static Type[] DiscoverTestExtensionTypesV2AttributeInternal(Assembly loa EqtTrace.Verbose($"MetadataReaderExtensionsHelper: Failure during assembly file load '{assemblyFilePath}', fallback to the loaded assembly.\n{FormatException(ex)}"); assemblyToAnalyze = loadedAssembly; } -#else - Assembly assemblyToAnalyze = loadedAssembly; -#endif List>? extensions = null; using (var stream = new FileStream(assemblyFilePath, FileMode.Open, FileAccess.Read)) diff --git a/src/Microsoft.TestPlatform.Common/Utilities/SimpleJSON.cs b/src/Microsoft.TestPlatform.Common/Utilities/SimpleJSON.cs index d202747a6b..73a65c5b20 100644 --- a/src/Microsoft.TestPlatform.Common/Utilities/SimpleJSON.cs +++ b/src/Microsoft.TestPlatform.Common/Utilities/SimpleJSON.cs @@ -522,11 +522,7 @@ private static JSONNode ParseElement(string token, bool quoted) return token; if (token.Length <= 5) { - string tmp = token.ToLower( -#if !NETSTANDARD1_3 - CultureInfo.InvariantCulture -#endif - ); + string tmp = token.ToLower(CultureInfo.InvariantCulture); if (tmp is "false" or "true") return tmp == "true"; if (tmp == "null") diff --git a/src/Microsoft.TestPlatform.CommunicationUtilities/Microsoft.TestPlatform.CommunicationUtilities.csproj b/src/Microsoft.TestPlatform.CommunicationUtilities/Microsoft.TestPlatform.CommunicationUtilities.csproj index 422c75a4cf..56e0dd1eba 100644 --- a/src/Microsoft.TestPlatform.CommunicationUtilities/Microsoft.TestPlatform.CommunicationUtilities.csproj +++ b/src/Microsoft.TestPlatform.CommunicationUtilities/Microsoft.TestPlatform.CommunicationUtilities.csproj @@ -5,7 +5,7 @@ Microsoft.TestPlatform.CommunicationUtilities - net6.0;netstandard2.0;netstandard1.3;$(TargetNetFxVersion) + net6.0;netstandard2.0;$(TargetNetFxVersion) net6.0 false diff --git a/src/Microsoft.TestPlatform.CommunicationUtilities/PublicAPI/netstandard1.3/PublicAPI.Shipped.txt b/src/Microsoft.TestPlatform.CommunicationUtilities/PublicAPI/netstandard1.3/PublicAPI.Shipped.txt deleted file mode 100644 index 7dc5c58110..0000000000 --- a/src/Microsoft.TestPlatform.CommunicationUtilities/PublicAPI/netstandard1.3/PublicAPI.Shipped.txt +++ /dev/null @@ -1 +0,0 @@ -#nullable enable diff --git a/src/Microsoft.TestPlatform.CommunicationUtilities/PublicAPI/netstandard1.3/PublicAPI.Unshipped.txt b/src/Microsoft.TestPlatform.CommunicationUtilities/PublicAPI/netstandard1.3/PublicAPI.Unshipped.txt deleted file mode 100644 index 7dc5c58110..0000000000 --- a/src/Microsoft.TestPlatform.CommunicationUtilities/PublicAPI/netstandard1.3/PublicAPI.Unshipped.txt +++ /dev/null @@ -1 +0,0 @@ -#nullable enable diff --git a/src/Microsoft.TestPlatform.CommunicationUtilities/Serialization/TestObjectConverter.cs b/src/Microsoft.TestPlatform.CommunicationUtilities/Serialization/TestObjectConverter.cs index 5d6bf81035..f7fabcdbf7 100644 --- a/src/Microsoft.TestPlatform.CommunicationUtilities/Serialization/TestObjectConverter.cs +++ b/src/Microsoft.TestPlatform.CommunicationUtilities/Serialization/TestObjectConverter.cs @@ -107,9 +107,7 @@ internal class TestObjectConverter7 : JsonConverter public TestObjectConverter7() { -#if !NETSTANDARD1_3 TestPropertyCtor = typeof(TestProperty).GetConstructor(BindingFlags.NonPublic | BindingFlags.Instance, null, new Type[0], null); -#endif } /// diff --git a/src/Microsoft.TestPlatform.CommunicationUtilities/SocketClient.cs b/src/Microsoft.TestPlatform.CommunicationUtilities/SocketClient.cs index d162c5fe43..5ac70833f7 100644 --- a/src/Microsoft.TestPlatform.CommunicationUtilities/SocketClient.cs +++ b/src/Microsoft.TestPlatform.CommunicationUtilities/SocketClient.cs @@ -113,13 +113,8 @@ private void StopOnError(Exception? error) _stopped = true; // Close the client and dispose the underlying stream -#if NETFRAMEWORK // tcpClient.Close() calls tcpClient.Dispose(). _tcpClient?.Close(); -#else - // tcpClient.Close() not available for netstandard1.5. - _tcpClient?.Dispose(); -#endif _channel?.Dispose(); _cancellation.Dispose(); diff --git a/src/Microsoft.TestPlatform.CommunicationUtilities/SocketCommunicationManager.cs b/src/Microsoft.TestPlatform.CommunicationUtilities/SocketCommunicationManager.cs index ebd6aba8ba..9194a8e525 100644 --- a/src/Microsoft.TestPlatform.CommunicationUtilities/SocketCommunicationManager.cs +++ b/src/Microsoft.TestPlatform.CommunicationUtilities/SocketCommunicationManager.cs @@ -229,13 +229,8 @@ public bool WaitForServerConnection(int connectionTimeout) /// public void StopClient() { -#if NETFRAMEWORK // tcpClient.Close() calls tcpClient.Dispose(). _tcpClient?.Close(); -#else - // tcpClient.Close() not available for netstandard1.5. - _tcpClient?.Dispose(); -#endif _tcpClient = null; _binaryReader?.Dispose(); _binaryWriter?.Dispose(); diff --git a/src/Microsoft.TestPlatform.CommunicationUtilities/SocketServer.cs b/src/Microsoft.TestPlatform.CommunicationUtilities/SocketServer.cs index 3ab072694a..529f2bb638 100644 --- a/src/Microsoft.TestPlatform.CommunicationUtilities/SocketServer.cs +++ b/src/Microsoft.TestPlatform.CommunicationUtilities/SocketServer.cs @@ -133,13 +133,8 @@ private void StopOnError(Exception? error) _tcpListener.Stop(); // Close the client and dispose the underlying stream -#if NETFRAMEWORK // tcpClient.Close() calls tcpClient.Dispose(). _tcpClient?.Close(); -#else - // tcpClient.Close() not available for netstandard1.5. - _tcpClient?.Dispose(); -#endif _channel.Dispose(); _cancellation.Dispose(); diff --git a/src/Microsoft.TestPlatform.CoreUtilities/FeatureFlag/FeatureFlag.cs b/src/Microsoft.TestPlatform.CoreUtilities/FeatureFlag/FeatureFlag.cs index d61a4b260e..01aaadadd8 100644 --- a/src/Microsoft.TestPlatform.CoreUtilities/FeatureFlag/FeatureFlag.cs +++ b/src/Microsoft.TestPlatform.CoreUtilities/FeatureFlag/FeatureFlag.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -#if !NETSTANDARD1_0 - using System; using System.Collections.Concurrent; @@ -64,5 +62,3 @@ internal void SetFlag(string key, bool value) _cache[key] = value; } } - -#endif diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Helpers/DotnetHostHelper.cs b/src/Microsoft.TestPlatform.CoreUtilities/Helpers/DotnetHostHelper.cs index 47a89ff833..d234d63854 100644 --- a/src/Microsoft.TestPlatform.CoreUtilities/Helpers/DotnetHostHelper.cs +++ b/src/Microsoft.TestPlatform.CoreUtilities/Helpers/DotnetHostHelper.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -#if !NETSTANDARD1_0 - using System; using System.Diagnostics.CodeAnalysis; using System.Globalization; @@ -443,5 +441,3 @@ private bool IsValidArchitectureMuxer(PlatformArchitecture targetArchitecture, s return true; } } - -#endif diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Helpers/EnvironmentHelper.cs b/src/Microsoft.TestPlatform.CoreUtilities/Helpers/EnvironmentHelper.cs index 36579f9e18..6dda345959 100644 --- a/src/Microsoft.TestPlatform.CoreUtilities/Helpers/EnvironmentHelper.cs +++ b/src/Microsoft.TestPlatform.CoreUtilities/Helpers/EnvironmentHelper.cs @@ -1,9 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -#if !NETSTANDARD1_0 using System; -#endif using Microsoft.VisualStudio.TestPlatform.ObjectModel; @@ -19,12 +17,7 @@ public class EnvironmentHelper /// public static int GetConnectionTimeout() { - -#if NETSTANDARD1_0 - var envVarValue = string.Empty; -#else var envVarValue = Environment.GetEnvironmentVariable(VstestConnectionTimeout); -#endif if (!envVarValue.IsNullOrEmpty() && int.TryParse(envVarValue, out int value) && value >= 0) { diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Helpers/EnvironmentVariableHelper.cs b/src/Microsoft.TestPlatform.CoreUtilities/Helpers/EnvironmentVariableHelper.cs index c27c990936..618aa6cd7d 100644 --- a/src/Microsoft.TestPlatform.CoreUtilities/Helpers/EnvironmentVariableHelper.cs +++ b/src/Microsoft.TestPlatform.CoreUtilities/Helpers/EnvironmentVariableHelper.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -#if !NETSTANDARD1_0 - using System; using Microsoft.VisualStudio.TestPlatform.Utilities.Helpers.Interfaces; @@ -25,5 +23,3 @@ internal class EnvironmentVariableHelper : IEnvironmentVariableHelper public void SetEnvironmentVariable(string variable, string value) => Environment.SetEnvironmentVariable(variable, value); } - -#endif diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Helpers/FileHelper.cs b/src/Microsoft.TestPlatform.CoreUtilities/Helpers/FileHelper.cs index 40242708fd..6b75f6b8a1 100644 --- a/src/Microsoft.TestPlatform.CoreUtilities/Helpers/FileHelper.cs +++ b/src/Microsoft.TestPlatform.CoreUtilities/Helpers/FileHelper.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -#if !NETSTANDARD1_0 - using System; using System.Collections.Generic; using System.Diagnostics; @@ -122,5 +120,3 @@ public string GetTempPath() public long GetFileLength(string path) => new FileInfo(path).Length; } - -#endif diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Helpers/Interfaces/IFileHelper.cs b/src/Microsoft.TestPlatform.CoreUtilities/Helpers/Interfaces/IFileHelper.cs index 0fb176db09..1d61a75296 100644 --- a/src/Microsoft.TestPlatform.CoreUtilities/Helpers/Interfaces/IFileHelper.cs +++ b/src/Microsoft.TestPlatform.CoreUtilities/Helpers/Interfaces/IFileHelper.cs @@ -3,10 +3,8 @@ using System; using System.Diagnostics.CodeAnalysis; -#if !NETSTANDARD1_0 using System.Collections.Generic; using System.IO; -#endif namespace Microsoft.VisualStudio.TestPlatform.Utilities.Helpers.Interfaces; @@ -15,7 +13,6 @@ namespace Microsoft.VisualStudio.TestPlatform.Utilities.Helpers.Interfaces; /// public interface IFileHelper { -#if !NETSTANDARD1_0 /// /// Creates a directory. /// @@ -23,7 +20,6 @@ public interface IFileHelper /// for the created directory. DirectoryInfo CreateDirectory(string path); -#endif /// /// Gets the current directory /// @@ -44,7 +40,6 @@ public interface IFileHelper /// True if directory exists . bool DirectoryExists([NotNullWhen(true)] string? path); -#if !NETSTANDARD1_0 /// /// Gets a stream for the file. /// @@ -79,7 +74,6 @@ public interface IFileHelper /// Full path of the file. /// Attributes of the file. FileAttributes GetFileAttributes(string path); -#endif /// /// Gets the version information of the file. @@ -140,7 +134,6 @@ public interface IFileHelper /// void DeleteDirectory(string directoryPath, bool recursive); -#if !NETSTANDARD1_0 /// /// Gets all files in directory based on search pattern /// @@ -149,7 +142,6 @@ public interface IFileHelper /// Search option /// string[] string[] GetFiles(string path, string searchPattern, SearchOption searchOption); -#endif /// /// Deletes the specified file diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Helpers/Interfaces/IWindowsRegistryHelper.cs b/src/Microsoft.TestPlatform.CoreUtilities/Helpers/Interfaces/IWindowsRegistryHelper.cs index 08ace47c5d..e692007f3a 100644 --- a/src/Microsoft.TestPlatform.CoreUtilities/Helpers/Interfaces/IWindowsRegistryHelper.cs +++ b/src/Microsoft.TestPlatform.CoreUtilities/Helpers/Interfaces/IWindowsRegistryHelper.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -#if !NETSTANDARD1_0 - using System; using Microsoft.Win32; @@ -22,5 +20,3 @@ internal interface IRegistryKey : IDisposable string[]? GetSubKeyNames(); } - -#endif diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Helpers/WindowsRegistryHelper.cs b/src/Microsoft.TestPlatform.CoreUtilities/Helpers/WindowsRegistryHelper.cs index 51a675dea4..a5e8a20b50 100644 --- a/src/Microsoft.TestPlatform.CoreUtilities/Helpers/WindowsRegistryHelper.cs +++ b/src/Microsoft.TestPlatform.CoreUtilities/Helpers/WindowsRegistryHelper.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -#if !NETSTANDARD1_0 - using Microsoft.VisualStudio.TestPlatform.Utilities.Helpers.Interfaces; using Microsoft.Win32; @@ -46,5 +44,3 @@ public void Dispose() _registryKey?.Dispose(); } } - -#endif diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Microsoft.TestPlatform.CoreUtilities.csproj b/src/Microsoft.TestPlatform.CoreUtilities/Microsoft.TestPlatform.CoreUtilities.csproj index ab410d21d1..0d4f3914f7 100644 --- a/src/Microsoft.TestPlatform.CoreUtilities/Microsoft.TestPlatform.CoreUtilities.csproj +++ b/src/Microsoft.TestPlatform.CoreUtilities/Microsoft.TestPlatform.CoreUtilities.csproj @@ -6,10 +6,10 @@ Microsoft.TestPlatform.CoreUtilities - net6.0;netstandard2.0;netstandard1.3;$(TargetNetFxVersion);$(TargetNetCoreVersion) - false - $(TargetFrameworks);uap10.0;netstandard1.0 + $(TargetNetFxVersion);$(TargetNetCoreVersion);netstandard2.0;net6.0 + $(TargetFrameworks);uap10.0 net6.0 + false false @@ -39,12 +39,12 @@ - + - + @@ -74,9 +74,8 @@ - - - + + diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Output/ConsoleOutput.cs b/src/Microsoft.TestPlatform.CoreUtilities/Output/ConsoleOutput.cs index 86a58d1c27..c1952c5e98 100644 --- a/src/Microsoft.TestPlatform.CoreUtilities/Output/ConsoleOutput.cs +++ b/src/Microsoft.TestPlatform.CoreUtilities/Output/ConsoleOutput.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -#if !NETSTANDARD1_0 && !WINDOWS_UWP +#if !WINDOWS_UWP using System; using System.IO; diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Output/OutputExtensions.cs b/src/Microsoft.TestPlatform.CoreUtilities/Output/OutputExtensions.cs index a73e987495..c0bd65e275 100644 --- a/src/Microsoft.TestPlatform.CoreUtilities/Output/OutputExtensions.cs +++ b/src/Microsoft.TestPlatform.CoreUtilities/Output/OutputExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -#if !NETSTANDARD1_0 && !WINDOWS_UWP +#if !WINDOWS_UWP using System; using System.Globalization; diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Properties/AssemblyInfo.cs b/src/Microsoft.TestPlatform.CoreUtilities/Properties/AssemblyInfo.cs index 5d2a47c108..e84bde1ead 100644 --- a/src/Microsoft.TestPlatform.CoreUtilities/Properties/AssemblyInfo.cs +++ b/src/Microsoft.TestPlatform.CoreUtilities/Properties/AssemblyInfo.cs @@ -32,7 +32,5 @@ [assembly: InternalsVisibleTo("Microsoft.TestPlatform.CrossPlatEngine, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")] [assembly: InternalsVisibleTo("vstest.console.UnitTests, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")] -#if !NETSTANDARD1_0 // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("d472046e-ed17-4750-a2a3-29935b5215f6")] -#endif diff --git a/src/Microsoft.TestPlatform.CoreUtilities/PublicAPI/netstandard1.0/PublicAPI.Shipped.txt b/src/Microsoft.TestPlatform.CoreUtilities/PublicAPI/netstandard1.0/PublicAPI.Shipped.txt deleted file mode 100644 index 9743928142..0000000000 --- a/src/Microsoft.TestPlatform.CoreUtilities/PublicAPI/netstandard1.0/PublicAPI.Shipped.txt +++ /dev/null @@ -1,3 +0,0 @@ -#nullable enable -static Microsoft.VisualStudio.TestPlatform.ObjectModel.EqtTrace.TraceLevel.get -> Microsoft.VisualStudio.TestPlatform.ObjectModel.PlatformTraceLevel -static Microsoft.VisualStudio.TestPlatform.ObjectModel.EqtTrace.TraceLevel.set -> void diff --git a/src/Microsoft.TestPlatform.CoreUtilities/PublicAPI/netstandard1.0/PublicAPI.Unshipped.txt b/src/Microsoft.TestPlatform.CoreUtilities/PublicAPI/netstandard1.0/PublicAPI.Unshipped.txt deleted file mode 100644 index ab058de62d..0000000000 --- a/src/Microsoft.TestPlatform.CoreUtilities/PublicAPI/netstandard1.0/PublicAPI.Unshipped.txt +++ /dev/null @@ -1 +0,0 @@ -#nullable enable diff --git a/src/Microsoft.TestPlatform.CoreUtilities/PublicAPI/netstandard1.3/PublicAPI.Shipped.txt b/src/Microsoft.TestPlatform.CoreUtilities/PublicAPI/netstandard1.3/PublicAPI.Shipped.txt deleted file mode 100644 index dc4f1b293a..0000000000 --- a/src/Microsoft.TestPlatform.CoreUtilities/PublicAPI/netstandard1.3/PublicAPI.Shipped.txt +++ /dev/null @@ -1,13 +0,0 @@ -#nullable enable -Microsoft.VisualStudio.TestPlatform.Utilities.ConsoleOutput -Microsoft.VisualStudio.TestPlatform.Utilities.ConsoleOutput.Write(string? message, Microsoft.VisualStudio.TestPlatform.Utilities.OutputLevel level) -> void -Microsoft.VisualStudio.TestPlatform.Utilities.ConsoleOutput.WriteLine(string? message, Microsoft.VisualStudio.TestPlatform.Utilities.OutputLevel level) -> void -Microsoft.VisualStudio.TestPlatform.Utilities.OutputExtensions -static Microsoft.VisualStudio.TestPlatform.ObjectModel.EqtTrace.TraceLevel.get -> Microsoft.VisualStudio.TestPlatform.ObjectModel.PlatformTraceLevel -static Microsoft.VisualStudio.TestPlatform.ObjectModel.EqtTrace.TraceLevel.set -> void -static Microsoft.VisualStudio.TestPlatform.Utilities.ConsoleOutput.Instance.get -> Microsoft.VisualStudio.TestPlatform.Utilities.ConsoleOutput! -static Microsoft.VisualStudio.TestPlatform.Utilities.OutputExtensions.Error(this Microsoft.VisualStudio.TestPlatform.Utilities.IOutput! output, bool appendPrefix, string! format, params object?[]? args) -> void -static Microsoft.VisualStudio.TestPlatform.Utilities.OutputExtensions.Information(this Microsoft.VisualStudio.TestPlatform.Utilities.IOutput! output, bool appendPrefix, string! format, params object?[]? args) -> void -static Microsoft.VisualStudio.TestPlatform.Utilities.OutputExtensions.Information(this Microsoft.VisualStudio.TestPlatform.Utilities.IOutput! output, bool appendPrefix, System.ConsoleColor foregroundColor, string! format, params object?[]? args) -> void -static Microsoft.VisualStudio.TestPlatform.Utilities.OutputExtensions.Warning(this Microsoft.VisualStudio.TestPlatform.Utilities.IOutput! output, bool appendPrefix, string! format, params object?[]? args) -> void -static Microsoft.VisualStudio.TestPlatform.Utilities.OutputExtensions.Write(this Microsoft.VisualStudio.TestPlatform.Utilities.IOutput! output, string! message, Microsoft.VisualStudio.TestPlatform.Utilities.OutputLevel level, System.ConsoleColor foregroundColor) -> void diff --git a/src/Microsoft.TestPlatform.CoreUtilities/PublicAPI/netstandard1.3/PublicAPI.Unshipped.txt b/src/Microsoft.TestPlatform.CoreUtilities/PublicAPI/netstandard1.3/PublicAPI.Unshipped.txt deleted file mode 100644 index ab058de62d..0000000000 --- a/src/Microsoft.TestPlatform.CoreUtilities/PublicAPI/netstandard1.3/PublicAPI.Unshipped.txt +++ /dev/null @@ -1 +0,0 @@ -#nullable enable diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Tracing/EqtTrace.cs b/src/Microsoft.TestPlatform.CoreUtilities/Tracing/EqtTrace.cs index c7684f9d4a..24ce929312 100644 --- a/src/Microsoft.TestPlatform.CoreUtilities/Tracing/EqtTrace.cs +++ b/src/Microsoft.TestPlatform.CoreUtilities/Tracing/EqtTrace.cs @@ -822,12 +822,6 @@ private static void WriteAtLevel(PlatformTraceLevel level, string format, params private static void FailDebugger(string? message) { -#if DEBUG -#if NETSTANDARD1_0 - TPDebug.Assert(false, message); -#else Debug.Fail(message); -#endif -#endif } } diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Tracing/TestPlatformEventSource.cs b/src/Microsoft.TestPlatform.CoreUtilities/Tracing/TestPlatformEventSource.cs index 00a1908d8e..42f1faa74c 100644 --- a/src/Microsoft.TestPlatform.CoreUtilities/Tracing/TestPlatformEventSource.cs +++ b/src/Microsoft.TestPlatform.CoreUtilities/Tracing/TestPlatformEventSource.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -#if !NETSTANDARD1_0 - using System.Diagnostics.Tracing; using Microsoft.VisualStudio.TestPlatform.CoreUtilities.Tracing.Interfaces; @@ -339,5 +337,3 @@ public void TranslationLayerStopTestSessionStop() WriteEvent(TestPlatformInstrumentationEvents.TranslationLayerStopTestSessionStopEventId); } } - -#endif diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Adapter/FrameworkHandle.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Adapter/FrameworkHandle.cs index e90da7f031..bb6ba1f463 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Adapter/FrameworkHandle.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Adapter/FrameworkHandle.cs @@ -98,9 +98,7 @@ public int LaunchProcessWithDebuggerAttached(string filePath, string? workingDir /// public bool AttachDebuggerToProcess(int pid) { -#if NETSTANDARD1_3 - var fmw = Framework.DefaultFramework.ToString(); -#elif NETSTANDARD || NET +#if NETSTANDARD || NET var fmw = System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription; #else var fmw = Framework.DefaultFramework.ToString(); diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Microsoft.TestPlatform.CrossPlatEngine.csproj b/src/Microsoft.TestPlatform.CrossPlatEngine/Microsoft.TestPlatform.CrossPlatEngine.csproj index 1f746ac353..33748b0113 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Microsoft.TestPlatform.CrossPlatEngine.csproj +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Microsoft.TestPlatform.CrossPlatEngine.csproj @@ -6,7 +6,7 @@ Microsoft.TestPlatform.CrossPlatEngine - net6.0;netstandard2.0;netstandard1.3;$(TargetNetFxVersion) + net6.0;netstandard2.0;$(TargetNetFxVersion) net6.0 false @@ -25,9 +25,6 @@ true - - - diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/PublicAPI/netstandard1.3/PublicAPI.Shipped.txt b/src/Microsoft.TestPlatform.CrossPlatEngine/PublicAPI/netstandard1.3/PublicAPI.Shipped.txt deleted file mode 100644 index 7dc5c58110..0000000000 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/PublicAPI/netstandard1.3/PublicAPI.Shipped.txt +++ /dev/null @@ -1 +0,0 @@ -#nullable enable diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/PublicAPI/netstandard1.3/PublicAPI.Unshipped.txt b/src/Microsoft.TestPlatform.CrossPlatEngine/PublicAPI/netstandard1.3/PublicAPI.Unshipped.txt deleted file mode 100644 index 7dc5c58110..0000000000 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/PublicAPI/netstandard1.3/PublicAPI.Unshipped.txt +++ /dev/null @@ -1 +0,0 @@ -#nullable enable diff --git a/src/Microsoft.TestPlatform.Execution.Shared/UILanguageOverride.cs b/src/Microsoft.TestPlatform.Execution.Shared/UILanguageOverride.cs index a700017e5f..a4244f0441 100644 --- a/src/Microsoft.TestPlatform.Execution.Shared/UILanguageOverride.cs +++ b/src/Microsoft.TestPlatform.Execution.Shared/UILanguageOverride.cs @@ -58,7 +58,6 @@ private static void ApplyOverrideToCurrentProcess(CultureInfo language, Action is set by VS and we respect that as well so that we will respect the VS // language preference if we're invoked by VS. string? vsLang = environmentVariableHelper.GetEnvironmentVariable(VSLANG); @@ -71,7 +70,7 @@ private static void ApplyOverrideToCurrentProcess(CultureInfo language, Action /// Default results directory. /// - public static readonly string DefaultResultsDirectory = -#if NETSTANDARD1_0 - Path.Combine(".", ResultsDirectoryName); -#else - Path.Combine(Directory.GetCurrentDirectory(), ResultsDirectoryName); -#endif + public static readonly string DefaultResultsDirectory = Path.Combine(Directory.GetCurrentDirectory(), ResultsDirectoryName); /// /// Default treatment of error from test adapters. diff --git a/src/Microsoft.TestPlatform.ObjectModel/Framework.cs b/src/Microsoft.TestPlatform.ObjectModel/Framework.cs index 80a4e7f8f0..1311c6ce8a 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Framework.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Framework.cs @@ -3,16 +3,13 @@ using Microsoft.VisualStudio.TestPlatform.CoreUtilities; -#if !NETSTANDARD1_0 - -#if !NETCOREAPP1_0 && !NETSTANDARD1_0 && !NETSTANDARD1_3 && !WINDOWS_UWP +#if !WINDOWS_UWP using System.Globalization; #endif using NuGet.Frameworks; using static NuGet.Frameworks.FrameworkConstants; -#endif namespace Microsoft.VisualStudio.TestPlatform.ObjectModel; @@ -32,10 +29,8 @@ private Framework() /// #if NETFRAMEWORK public static Framework DefaultFramework { get; } = Framework.FromString(".NETFramework,Version=v4.0")!; -#elif !NETSTANDARD1_0 - public static Framework DefaultFramework { get; } = Framework.FromString(".NETCoreApp,Version=v1.0")!; #else - public static Framework? DefaultFramework { get; } + public static Framework DefaultFramework { get; } = Framework.FromString(".NETCoreApp,Version=v1.0")!; #endif /// @@ -55,19 +50,6 @@ private Framework() /// A framework object public static Framework? FromString(string? frameworkString) { -#if NETSTANDARD1_0 -#pragma warning disable IDE1006 // Naming Styles - var CommonFrameworks = new -#pragma warning restore IDE1006 // Naming Styles - { - Net35 = new { DotNetFrameworkName = Constants.DotNetFramework35, Version = "3.5.0.0" }, - Net4 = new { DotNetFrameworkName = Constants.DotNetFramework40, Version = "4.0.0.0" }, - Net45 = new { DotNetFrameworkName = Constants.DotNetFramework45, Version = "4.5.0.0" }, - NetCoreApp10 = new { DotNetFrameworkName = Constants.DotNetFrameworkCore10, Version = "1.0.0.0" }, - UAP10 = new { DotNetFrameworkName = Constants.DotNetFrameworkUap10, Version = "10.0.0.0" }, - }; -#endif - if (frameworkString.IsNullOrWhiteSpace()) { return null; @@ -80,7 +62,7 @@ private Framework() // This throws up in first chance exception, refer Bug https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_workitems/edit/591142 var formattedFrameworkString = frameworkString.Trim() .ToLower( -#if !NETCOREAPP1_0 && !NETSTANDARD1_0 && !NETSTANDARD1_3 && !WINDOWS_UWP +#if !WINDOWS_UWP CultureInfo.InvariantCulture #endif ); @@ -112,9 +94,6 @@ private Framework() break; default: -#if NETSTANDARD1_0 - return null; -#else var nugetFramework = NuGetFramework.Parse(frameworkString); if (nugetFramework.IsUnsupported) return null; @@ -123,7 +102,6 @@ private Framework() version = nugetFramework.Version.ToString(); break; -#endif } } catch diff --git a/src/Microsoft.TestPlatform.ObjectModel/Logger/LoggerRunSettings.cs b/src/Microsoft.TestPlatform.ObjectModel/Logger/LoggerRunSettings.cs index d149a93b48..a69cbd4222 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Logger/LoggerRunSettings.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Logger/LoggerRunSettings.cs @@ -40,7 +40,6 @@ public Collection LoggerSettingsList private set; } -#if !NETSTANDARD1_0 public override XmlElement ToXml() { var doc = new XmlDocument(); @@ -56,7 +55,6 @@ public override XmlElement ToXml() return root; } -#endif /// /// The from xml. diff --git a/src/Microsoft.TestPlatform.ObjectModel/Logger/LoggerSettings.cs b/src/Microsoft.TestPlatform.ObjectModel/Logger/LoggerSettings.cs index c4892a15d5..b72b1c7e45 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Logger/LoggerSettings.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Logger/LoggerSettings.cs @@ -59,7 +59,6 @@ public bool IsEnabled set; } -#if !NETSTANDARD1_0 /// /// Gets or sets the configuration. /// @@ -119,7 +118,6 @@ private static void AppendAttribute(XmlDocument doc, XmlElement owner, string at attribute.Value = attributeValue; owner.Attributes.Append(attribute); } -#endif internal static LoggerSettings FromXml(XmlReader reader) { @@ -146,11 +144,7 @@ internal static LoggerSettings FromXml(XmlReader reader) { settings.Uri = new Uri(reader.Value); } -#if NETSTANDARD1_0 - catch -#else catch (UriFormatException) -#endif { throw new SettingsException( string.Format( @@ -210,18 +204,14 @@ internal static LoggerSettings FromXml(XmlReader reader) // Read inner elements. while (reader.NodeType == XmlNodeType.Element) { -#pragma warning disable IDE0066 // Convert switch statement to expression switch (reader.Name.ToLowerInvariant()) { -#pragma warning restore IDE0066 // Convert switch statement to expression -#if !NETSTANDARD1_0 case Constants.LoggerConfigurationNameLower: var document = new XmlDocument(); var element = document.CreateElement(reader.Name); element.InnerXml = reader.ReadInnerXml(); settings.Configuration = element; break; -#endif default: throw new SettingsException( string.Format( diff --git a/src/Microsoft.TestPlatform.ObjectModel/Microsoft.TestPlatform.ObjectModel.csproj b/src/Microsoft.TestPlatform.ObjectModel/Microsoft.TestPlatform.ObjectModel.csproj index 08ca15093b..f3aa827767 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Microsoft.TestPlatform.ObjectModel.csproj +++ b/src/Microsoft.TestPlatform.ObjectModel/Microsoft.TestPlatform.ObjectModel.csproj @@ -6,8 +6,8 @@ Microsoft.VisualStudio.TestPlatform.ObjectModel - $(TargetNetFxVersion);$(TargetNetCoreVersion);netstandard2.0;netstandard1.3 - $(TargetFrameworks);uap10.0;netstandard1.0 + $(TargetNetFxVersion);$(TargetNetCoreVersion);netstandard2.0 + $(TargetFrameworks);uap10.0 net6.0 Microsoft.TestPlatform.ObjectModel @@ -35,30 +35,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - + @@ -73,11 +50,6 @@ - - - - - @@ -118,9 +90,8 @@ - - - + + diff --git a/src/Microsoft.TestPlatform.ObjectModel/Navigation/PortableSymbolReader.cs b/src/Microsoft.TestPlatform.ObjectModel/Navigation/PortableSymbolReader.cs index 61fd07983a..643c6023d2 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Navigation/PortableSymbolReader.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Navigation/PortableSymbolReader.cs @@ -103,7 +103,7 @@ private void PopulateCacheForTypeAndMethodSymbols(string binaryPath) } catch (FileNotFoundException) { -#if !NETSTANDARD1_3 && !WINDOWS_UWP && !NETCOREAPP1_0 +#if !WINDOWS_UWP // fallback when the assembly is not loaded asm = Assembly.LoadFile(binaryPath); #else diff --git a/src/Microsoft.TestPlatform.ObjectModel/Properties/AssemblyInfo.cs b/src/Microsoft.TestPlatform.ObjectModel/Properties/AssemblyInfo.cs index ff0a18e767..3784165687 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Properties/AssemblyInfo.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Properties/AssemblyInfo.cs @@ -25,10 +25,8 @@ // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] -#if !NETSTANDARD1_0 // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("8a200cda-4813-43a1-aa18-9faedc31d2af")] -#endif // Type forwarding utility classes defined earlier in object model to a core utilities assembly. [assembly: TypeForwardedTo(typeof(EqtTrace))] diff --git a/src/Microsoft.TestPlatform.ObjectModel/PublicAPI/netstandard1.0/PublicAPI.Shipped.txt b/src/Microsoft.TestPlatform.ObjectModel/PublicAPI/netstandard1.0/PublicAPI.Shipped.txt deleted file mode 100644 index b341758184..0000000000 --- a/src/Microsoft.TestPlatform.ObjectModel/PublicAPI/netstandard1.0/PublicAPI.Shipped.txt +++ /dev/null @@ -1,4 +0,0 @@ -#nullable enable -static Microsoft.VisualStudio.TestPlatform.ObjectModel.EqtTrace.TraceLevel.get -> Microsoft.VisualStudio.TestPlatform.ObjectModel.PlatformTraceLevel (forwarded, contained in Microsoft.TestPlatform.CoreUtilities) -static Microsoft.VisualStudio.TestPlatform.ObjectModel.EqtTrace.TraceLevel.set -> void (forwarded, contained in Microsoft.TestPlatform.CoreUtilities) -static Microsoft.VisualStudio.TestPlatform.ObjectModel.Framework.DefaultFramework.get -> Microsoft.VisualStudio.TestPlatform.ObjectModel.Framework? diff --git a/src/Microsoft.TestPlatform.ObjectModel/PublicAPI/netstandard1.0/PublicAPI.Unshipped.txt b/src/Microsoft.TestPlatform.ObjectModel/PublicAPI/netstandard1.0/PublicAPI.Unshipped.txt deleted file mode 100644 index ab058de62d..0000000000 --- a/src/Microsoft.TestPlatform.ObjectModel/PublicAPI/netstandard1.0/PublicAPI.Unshipped.txt +++ /dev/null @@ -1 +0,0 @@ -#nullable enable diff --git a/src/Microsoft.TestPlatform.ObjectModel/PublicAPI/netstandard1.3/PublicAPI.Shipped.txt b/src/Microsoft.TestPlatform.ObjectModel/PublicAPI/netstandard1.3/PublicAPI.Shipped.txt deleted file mode 100644 index 2ceb9ba877..0000000000 --- a/src/Microsoft.TestPlatform.ObjectModel/PublicAPI/netstandard1.3/PublicAPI.Shipped.txt +++ /dev/null @@ -1,4 +0,0 @@ -#nullable enable -static Microsoft.VisualStudio.TestPlatform.ObjectModel.EqtTrace.TraceLevel.get -> Microsoft.VisualStudio.TestPlatform.ObjectModel.PlatformTraceLevel (forwarded, contained in Microsoft.TestPlatform.CoreUtilities) -static Microsoft.VisualStudio.TestPlatform.ObjectModel.EqtTrace.TraceLevel.set -> void (forwarded, contained in Microsoft.TestPlatform.CoreUtilities) -static Microsoft.VisualStudio.TestPlatform.ObjectModel.Framework.DefaultFramework.get -> Microsoft.VisualStudio.TestPlatform.ObjectModel.Framework! diff --git a/src/Microsoft.TestPlatform.ObjectModel/PublicAPI/netstandard1.3/PublicAPI.Unshipped.txt b/src/Microsoft.TestPlatform.ObjectModel/PublicAPI/netstandard1.3/PublicAPI.Unshipped.txt deleted file mode 100644 index ab058de62d..0000000000 --- a/src/Microsoft.TestPlatform.ObjectModel/PublicAPI/netstandard1.3/PublicAPI.Unshipped.txt +++ /dev/null @@ -1 +0,0 @@ -#nullable enable diff --git a/src/Microsoft.TestPlatform.ObjectModel/RunSettings/RunConfiguration.cs b/src/Microsoft.TestPlatform.ObjectModel/RunSettings/RunConfiguration.cs index 05d28b5e48..29c1f106d1 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/RunSettings/RunConfiguration.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/RunSettings/RunConfiguration.cs @@ -435,7 +435,6 @@ public bool ResultsDirectorySet /// public string? DotnetHostPath { get; private set; } -#if !NETSTANDARD1_0 /// public override XmlElement ToXml() { @@ -553,7 +552,6 @@ public override XmlElement ToXml() return root; } -#endif /// /// Loads RunConfiguration from XmlReader. @@ -600,7 +598,7 @@ public static RunConfiguration FromXml(XmlReader reader) XmlRunSettingsUtilities.ThrowOnHasAttributes(reader); string collectSourceInformationStr = reader.ReadElementContentAsString(); - bool bCollectSourceInformation = true; + bool bCollectSourceInformation; if (!bool.TryParse(collectSourceInformationStr, out bCollectSourceInformation)) { throw new SettingsException(string.Format(CultureInfo.CurrentCulture, @@ -813,7 +811,7 @@ public static RunConfiguration FromXml(XmlReader reader) case "TreatTestAdapterErrorsAsWarnings": XmlRunSettingsUtilities.ThrowOnHasAttributes(reader); - bool treatTestAdapterErrorsAsWarnings = false; + bool treatTestAdapterErrorsAsWarnings; value = reader.ReadElementContentAsString(); @@ -838,16 +836,10 @@ public static RunConfiguration FromXml(XmlReader reader) case "SolutionDirectory": XmlRunSettingsUtilities.ThrowOnHasAttributes(reader); string? solutionDirectory = reader.ReadElementContentAsString(); - -#if !NETSTANDARD1_0 solutionDirectory = Environment.ExpandEnvironmentVariables(solutionDirectory); -#endif - if (StringUtils.IsNullOrEmpty(solutionDirectory) -#if !NETSTANDARD1_0 - || !System.IO.Directory.Exists(solutionDirectory) -#endif - ) + if (solutionDirectory.IsNullOrEmpty() + || !System.IO.Directory.Exists(solutionDirectory)) { EqtTrace.Error(string.Format(CultureInfo.CurrentCulture, Resources.Resources.SolutionDirectoryNotExists, solutionDirectory)); solutionDirectory = null; diff --git a/src/Microsoft.TestPlatform.ObjectModel/RunSettings/TestRunSettings.cs b/src/Microsoft.TestPlatform.ObjectModel/RunSettings/TestRunSettings.cs index 280aeebade..1d5b682ce9 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/RunSettings/TestRunSettings.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/RunSettings/TestRunSettings.cs @@ -1,9 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -#if !NETSTANDARD1_0 using System.Xml; -#endif namespace Microsoft.VisualStudio.TestPlatform.ObjectModel; @@ -31,12 +29,10 @@ protected TestRunSettings(string name) /// public string Name { get; } -#if !NETSTANDARD1_0 /// /// Converter the setting to be an XmlElement. /// /// The Xml element for the run settings provided. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1059:MembersShouldNotExposeCertainConcreteTypes", Justification = "XmlElement is required in the data collector.")] public abstract XmlElement ToXml(); -#endif } diff --git a/src/Microsoft.TestPlatform.ObjectModel/TestProperty/TestProperty.cs b/src/Microsoft.TestPlatform.ObjectModel/TestProperty/TestProperty.cs index 150ae2a895..7555f82793 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/TestProperty/TestProperty.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/TestProperty/TestProperty.cs @@ -2,18 +2,14 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; -#if !NETSTANDARD1_0 using System.Collections.Concurrent; -#endif using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Reflection; using System.Runtime.Serialization; -#if !NETSTANDARD1_0 using Microsoft.VisualStudio.TestPlatform.Utilities; -#endif namespace Microsoft.VisualStudio.TestPlatform.ObjectModel; @@ -22,18 +18,11 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel; [DataContract] public class TestProperty : IEquatable { - private Type _valueType; -#if !NETSTANDARD1_0 private static readonly ConcurrentDictionary TypeCache = new(); -#else - private static readonly Dictionary TypeCache = new(); -#endif -#if NETSTANDARD1_0 - private static bool DisableFastJson { get; set; } = true; -#else private static bool DisableFastJson { get; set; } = FeatureFlag.Instance.IsSet(FeatureFlag.DISABLE_FASTER_JSON_SERIALIZATION); -#endif + + private Type _valueType; //public static Stopwatch @@ -196,11 +185,7 @@ private Type GetType(string typeName) { if (type != null) { -#if !NETSTANDARD1_0 TypeCache.TryAdd(typeName, type); -#else - TypeCache[typeName] = type; -#endif return type; } } @@ -263,11 +248,7 @@ private Type GetType(string typeName) if (!DisableFastJson) { -#if !NETSTANDARD1_0 TypeCache.TryAdd(typeName, type); -#else - TypeCache[typeName] = type; -#endif } return type; } diff --git a/src/Microsoft.TestPlatform.ObjectModel/TestServiceLocator.cs b/src/Microsoft.TestPlatform.ObjectModel/TestServiceLocator.cs index eb72662489..a518e678d5 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/TestServiceLocator.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/TestServiceLocator.cs @@ -1,13 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. - // We don't want this in our shipped code. Build only for debug until I am able to remove it. #if DEBUG -#if !NETSTANDARD1_0 using System; -#endif using System.Collections.Generic; namespace Microsoft.VisualStudio.TestPlatform.ObjectModel; @@ -33,9 +30,7 @@ public static class TestServiceLocator // throw new InvalidOperationException($"Cannot find an instance for name {name}."); } -#if !NETSTANDARD1_0 Resolves.Add(new Resolve(name, typeof(TRegistration).FullName!, Environment.StackTrace)); -#endif return (TRegistration)instance; } diff --git a/src/Microsoft.TestPlatform.ObjectModel/Utilities/Sha1Helper.cs b/src/Microsoft.TestPlatform.ObjectModel/Utilities/Sha1Helper.cs index 0d457ae7c3..f424fbba41 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Utilities/Sha1Helper.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Utilities/Sha1Helper.cs @@ -2,9 +2,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; -#if !NETSTANDARD1_0 using System.Security.Cryptography; -#endif namespace Microsoft.VisualStudio.TestPlatform.ObjectModel.Utilities; @@ -17,16 +15,10 @@ internal static class Sha1Helper { public static byte[] ComputeSha1(byte[] message) { -#if NETSTANDARD1_0 - var hasher = new Sha1Implementation(); - - return hasher.ComputeHash(message); -#else using HashAlgorithm provider = SHA1.Create(); byte[] hash = provider.ComputeHash(message); return hash; -#endif } /// diff --git a/src/Microsoft.TestPlatform.ObjectModel/Utilities/XmlRunSettingsUtilities.cs b/src/Microsoft.TestPlatform.ObjectModel/Utilities/XmlRunSettingsUtilities.cs index eb13451793..2912dbe98f 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Utilities/XmlRunSettingsUtilities.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Utilities/XmlRunSettingsUtilities.cs @@ -6,13 +6,9 @@ using System.Globalization; using System.IO; using System.Xml; - -using Microsoft.VisualStudio.TestPlatform.CoreUtilities; - -#if !NETSTANDARD1_0 using System.Xml.XPath; -#endif +using Microsoft.VisualStudio.TestPlatform.CoreUtilities; using Microsoft.VisualStudio.TestPlatform.PlatformAbstractions; using ObjectModelResources = Microsoft.VisualStudio.TestPlatform.ObjectModel.Resources.Resources; @@ -55,7 +51,6 @@ public static XmlReaderSettings ReaderSettings } } -#if !NETSTANDARD1_0 /// /// Examines the given XPathNavigable representation of a runsettings file and determines if it has a configuration node /// for the data collector (used for Fakes and CodeCoverage) @@ -130,7 +125,6 @@ public static void InsertDataCollectorsNode(IXPathNavigable runSettingDocument, navigator.AppendChild(dataCollectorNode); } -#endif /// /// Returns RunConfiguration from settingsXml. @@ -167,7 +161,6 @@ public static RunConfiguration GetRunConfigurationNode(string? settingsXml) return nodeValue; } -#if !NETSTANDARD1_0 /// /// Create a default run settings /// @@ -306,8 +299,6 @@ public static bool IsInProcDataCollectionEnabled(string? runSettingsXml) return DataCollectionRunSettings.FromXml(reader, Constants.InProcDataCollectionRunSettingsName, Constants.InProcDataCollectorsSettingName, Constants.InProcDataCollectorSettingName); } -#endif - /// /// Get logger run settings from the settings XML. /// @@ -396,7 +387,6 @@ internal static void ThrowOnNoAttributes(XmlReader reader) return default; } -#if !NETSTANDARD1_0 /// /// Moves the given runsettings file navigator to the DataCollectors node in the runsettings xml. /// Throws XmlException if it was unable to find the DataCollectors node. @@ -422,5 +412,4 @@ private static void MoveToDataCollectorsNode(ref XPathNavigator runSettingsNavig runSettingsNavigator.MoveToChild("DataCollectors", string.Empty); } } -#endif } diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/Microsoft.TestPlatform.PlatformAbstractions.csproj b/src/Microsoft.TestPlatform.PlatformAbstractions/Microsoft.TestPlatform.PlatformAbstractions.csproj index b87db8e4d5..0e45ee6ab2 100644 --- a/src/Microsoft.TestPlatform.PlatformAbstractions/Microsoft.TestPlatform.PlatformAbstractions.csproj +++ b/src/Microsoft.TestPlatform.PlatformAbstractions/Microsoft.TestPlatform.PlatformAbstractions.csproj @@ -7,8 +7,8 @@ Microsoft.TestPlatform.PlatformAbstractions Microsoft.TestPlatform.PlatformAbstractions - $(TargetNetFxVersion);$(TargetNetCoreVersion);netstandard1.3;netstandard2.0;net6.0 - $(TargetFrameworks);uap10.0;netstandard1.0 + $(TargetNetFxVersion);$(TargetNetCoreVersion);netstandard2.0;net6.0 + $(TargetFrameworks);uap10.0 net6.0 false $(NoWarn);NU1605 @@ -60,9 +60,8 @@ - - - + + diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/PublicAPI/netstandard1.0/PublicAPI.Shipped.txt b/src/Microsoft.TestPlatform.PlatformAbstractions/PublicAPI/netstandard1.0/PublicAPI.Shipped.txt deleted file mode 100644 index ccdad87559..0000000000 --- a/src/Microsoft.TestPlatform.PlatformAbstractions/PublicAPI/netstandard1.0/PublicAPI.Shipped.txt +++ /dev/null @@ -1,7 +0,0 @@ -#nullable enable -Microsoft.VisualStudio.TestPlatform.ObjectModel.PlatformEqtTrace.InitializeTrace(string? customLogFile, Microsoft.VisualStudio.TestPlatform.ObjectModel.PlatformTraceLevel traceLevel) -> bool -Microsoft.VisualStudio.TestPlatform.ObjectModel.PlatformEqtTrace.WriteLine(Microsoft.VisualStudio.TestPlatform.ObjectModel.PlatformTraceLevel traceLevel, string? message) -> void -Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformThread.Run(System.Action? action, Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformApartmentState platformApartmentState, bool waitForCompletion) -> void -Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.ProcessHelper.GetProcessById(int processId) -> object! -Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.ProcessHelper.LaunchProcess(string! processPath, string? arguments, string? workingDirectory, System.Collections.Generic.IDictionary? envVariables, System.Action? errorCallback, System.Action? exitCallBack, System.Action? outputCallBack) -> object! -Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.ProcessHelper.SetExitCallback(int parentProcessId, System.Action? callbackAction) -> void diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/PublicAPI/netstandard1.0/PublicAPI.Unshipped.txt b/src/Microsoft.TestPlatform.PlatformAbstractions/PublicAPI/netstandard1.0/PublicAPI.Unshipped.txt deleted file mode 100644 index ab058de62d..0000000000 --- a/src/Microsoft.TestPlatform.PlatformAbstractions/PublicAPI/netstandard1.0/PublicAPI.Unshipped.txt +++ /dev/null @@ -1 +0,0 @@ -#nullable enable diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/PublicAPI/netstandard1.3/PublicAPI.Shipped.txt b/src/Microsoft.TestPlatform.PlatformAbstractions/PublicAPI/netstandard1.3/PublicAPI.Shipped.txt deleted file mode 100644 index ccdad87559..0000000000 --- a/src/Microsoft.TestPlatform.PlatformAbstractions/PublicAPI/netstandard1.3/PublicAPI.Shipped.txt +++ /dev/null @@ -1,7 +0,0 @@ -#nullable enable -Microsoft.VisualStudio.TestPlatform.ObjectModel.PlatformEqtTrace.InitializeTrace(string? customLogFile, Microsoft.VisualStudio.TestPlatform.ObjectModel.PlatformTraceLevel traceLevel) -> bool -Microsoft.VisualStudio.TestPlatform.ObjectModel.PlatformEqtTrace.WriteLine(Microsoft.VisualStudio.TestPlatform.ObjectModel.PlatformTraceLevel traceLevel, string? message) -> void -Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformThread.Run(System.Action? action, Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformApartmentState platformApartmentState, bool waitForCompletion) -> void -Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.ProcessHelper.GetProcessById(int processId) -> object! -Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.ProcessHelper.LaunchProcess(string! processPath, string? arguments, string? workingDirectory, System.Collections.Generic.IDictionary? envVariables, System.Action? errorCallback, System.Action? exitCallBack, System.Action? outputCallBack) -> object! -Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.ProcessHelper.SetExitCallback(int parentProcessId, System.Action? callbackAction) -> void diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/PublicAPI/netstandard1.3/PublicAPI.Unshipped.txt b/src/Microsoft.TestPlatform.PlatformAbstractions/PublicAPI/netstandard1.3/PublicAPI.Unshipped.txt deleted file mode 100644 index ab058de62d..0000000000 --- a/src/Microsoft.TestPlatform.PlatformAbstractions/PublicAPI/netstandard1.3/PublicAPI.Unshipped.txt +++ /dev/null @@ -1 +0,0 @@ -#nullable enable diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/common/NativeMethods.cs b/src/Microsoft.TestPlatform.PlatformAbstractions/common/NativeMethods.cs index 680aae6d57..e75a249168 100644 --- a/src/Microsoft.TestPlatform.PlatformAbstractions/common/NativeMethods.cs +++ b/src/Microsoft.TestPlatform.PlatformAbstractions/common/NativeMethods.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -#if !NETSTANDARD1_0 - using System; using System.Runtime.InteropServices; @@ -24,5 +22,3 @@ internal class NativeMethods [return: MarshalAs(UnmanagedType.Bool)] internal static extern bool IsWow64Process([In] IntPtr process, [Out] out bool wow64Process); } - -#endif diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/common/System/ProcessHelper.cs b/src/Microsoft.TestPlatform.PlatformAbstractions/common/System/ProcessHelper.cs index 2efe82b7db..ef7e1a97db 100644 --- a/src/Microsoft.TestPlatform.PlatformAbstractions/common/System/ProcessHelper.cs +++ b/src/Microsoft.TestPlatform.PlatformAbstractions/common/System/ProcessHelper.cs @@ -6,9 +6,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; -#if !NETCOREAPP1_0 using System.Globalization; -#endif using System.IO; using System.Reflection; using System.Threading; diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/netstandard/IO/PlatformStream.cs b/src/Microsoft.TestPlatform.PlatformAbstractions/netstandard/IO/PlatformStream.cs deleted file mode 100644 index def1d7ceed..0000000000 --- a/src/Microsoft.TestPlatform.PlatformAbstractions/netstandard/IO/PlatformStream.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -#if NETSTANDARD && !NETSTANDARD2_0 - -using System; -using System.IO; - -using Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.Interfaces; - -namespace Microsoft.VisualStudio.TestPlatform.PlatformAbstractions; - -/// -public class PlatformStream : IStream -{ - /// - public Stream CreateBufferedStream(Stream stream, int bufferSize) - { - throw new NotImplementedException(); - } -} - -#endif diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/netstandard/Runtime/PlatformAssemblyExtensions.cs b/src/Microsoft.TestPlatform.PlatformAbstractions/netstandard/Runtime/PlatformAssemblyExtensions.cs deleted file mode 100644 index a203f23dbb..0000000000 --- a/src/Microsoft.TestPlatform.PlatformAbstractions/netstandard/Runtime/PlatformAssemblyExtensions.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -#if NETSTANDARD && !NETSTANDARD2_0 - -using System; -using System.Reflection; - -namespace Microsoft.VisualStudio.TestPlatform.PlatformAbstractions; - -public static class PlatformAssemblyExtensions -{ - public static string GetAssemblyLocation(this Assembly assembly) - { - throw new NotImplementedException(); - } -} - -#endif diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/netstandard/Runtime/PlatformAssemblyLoadContext.cs b/src/Microsoft.TestPlatform.PlatformAbstractions/netstandard/Runtime/PlatformAssemblyLoadContext.cs deleted file mode 100644 index f53b92a8da..0000000000 --- a/src/Microsoft.TestPlatform.PlatformAbstractions/netstandard/Runtime/PlatformAssemblyLoadContext.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -#if NETSTANDARD && !NETSTANDARD2_0 - -using System.Reflection; - -using Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.Interfaces; - -namespace Microsoft.VisualStudio.TestPlatform.PlatformAbstractions; - -/// -public class PlatformAssemblyLoadContext : IAssemblyLoadContext -{ - /// - public AssemblyName GetAssemblyNameFromPath(string assemblyPath) - { - throw new System.NotImplementedException(); - } - - /// - public Assembly LoadAssemblyFromPath(string assemblyPath) - { - throw new System.NotImplementedException(); - } -} - -#endif diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/netstandard/Runtime/PlatformAssemblyResolver.cs b/src/Microsoft.TestPlatform.PlatformAbstractions/netstandard/Runtime/PlatformAssemblyResolver.cs deleted file mode 100644 index a1f033b5dc..0000000000 --- a/src/Microsoft.TestPlatform.PlatformAbstractions/netstandard/Runtime/PlatformAssemblyResolver.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -#if NETSTANDARD && !NETSTANDARD2_0 - -using System; - -using Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.Interfaces; - -namespace Microsoft.VisualStudio.TestPlatform.PlatformAbstractions; - -/// -public class PlatformAssemblyResolver : IAssemblyResolver -{ - public PlatformAssemblyResolver() - { - throw new NotImplementedException(); - } - - /// - public event AssemblyResolveEventHandler? AssemblyResolve; - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - protected virtual void Dispose(bool disposing) - { - throw new NotImplementedException(); - } - - private void DummyEventThrower() - { - AssemblyResolve?.Invoke(this, null); - } -} - -#endif diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/netstandard/System/PlatformEnvironment.cs b/src/Microsoft.TestPlatform.PlatformAbstractions/netstandard/System/PlatformEnvironment.cs deleted file mode 100644 index 377cf4b4d4..0000000000 --- a/src/Microsoft.TestPlatform.PlatformAbstractions/netstandard/System/PlatformEnvironment.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -#if NETSTANDARD && !NETSTANDARD2_0 - -using System; - -using Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.Interfaces; - -namespace Microsoft.VisualStudio.TestPlatform.PlatformAbstractions; - -/// -public class PlatformEnvironment : IEnvironment -{ - /// - public PlatformArchitecture Architecture - { - get - { - throw new NotImplementedException(); - } - } - - /// - public PlatformOperatingSystem OperatingSystem - { - get - { - throw new NotImplementedException(); - } - } - - /// - public string OperatingSystemVersion - { - get - { - throw new NotImplementedException(); - } - } - - /// - public int ProcessorCount => throw new NotImplementedException(); - - /// - public void Exit(int exitcode) - { - throw new NotImplementedException(); - } - - /// - public int GetCurrentManagedThreadId() - { - throw new NotImplementedException(); - } -} - -#endif diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/netstandard/System/PlatformThread.cs b/src/Microsoft.TestPlatform.PlatformAbstractions/netstandard/System/PlatformThread.cs deleted file mode 100644 index 82210bdf6f..0000000000 --- a/src/Microsoft.TestPlatform.PlatformAbstractions/netstandard/System/PlatformThread.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -#if NETSTANDARD && !NETSTANDARD2_0 - -using System; - -using Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.Interfaces; - -namespace Microsoft.VisualStudio.TestPlatform.PlatformAbstractions; - -/// -public class PlatformThread : IThread -{ - /// - public void Run(Action? action, PlatformApartmentState platformApartmentState, bool waitForCompletion) - { - throw new NotImplementedException(); - } -} - -#endif diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/netstandard/System/ProcessHelper.cs b/src/Microsoft.TestPlatform.PlatformAbstractions/netstandard/System/ProcessHelper.cs deleted file mode 100644 index 4105394a18..0000000000 --- a/src/Microsoft.TestPlatform.PlatformAbstractions/netstandard/System/ProcessHelper.cs +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -#if NETSTANDARD && !NETSTANDARD2_0 - -using System; -using System.Collections.Generic; - -using Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.Interfaces; - -namespace Microsoft.VisualStudio.TestPlatform.PlatformAbstractions; - -/// -/// Helper class to deal with process related functionality. -/// -public class ProcessHelper : IProcessHelper -{ - /// - public object LaunchProcess(string processPath, string? arguments, string? workingDirectory, IDictionary? envVariables, Action? errorCallback, Action? exitCallBack, Action? outputCallBack) - { - throw new NotImplementedException(); - } - - /// - public string? GetCurrentProcessFileName() - { - throw new NotImplementedException(); - } - - /// - public string GetCurrentProcessLocation() - { - throw new NotImplementedException(); - } - - /// - public string? GetTestEngineDirectory() - { - throw new NotImplementedException(); - } - - /// - public int GetCurrentProcessId() - { - throw new NotImplementedException(); - } - - /// - public string GetProcessName(int processId) - { - throw new NotImplementedException(); - } - - /// - public bool TryGetExitCode(object? process, out int exitCode) - { - throw new NotImplementedException(); - } - - /// - public void SetExitCallback(int parentProcessId, Action? callbackAction) - { - throw new NotImplementedException(); - } - - /// - public void TerminateProcess(object? process) - { - throw new NotImplementedException(); - } - - /// - public int GetProcessId(object? process) - { - throw new NotImplementedException(); - } - - /// - public string GetNativeDllDirectory() - { - throw new NotImplementedException(); - } - - /// - public PlatformArchitecture GetCurrentProcessArchitecture() - { - throw new NotImplementedException(); - } - - /// - public void WaitForProcessExit(object? process) - { - throw new NotImplementedException(); - } - - public IntPtr GetProcessHandle(int processId) - { - throw new NotImplementedException(); - } - - public object GetProcessById(int processId) - { - throw new NotImplementedException(); - } - - public PlatformArchitecture GetProcessArchitecture(int processId) - { - throw new NotImplementedException(); - } -} - -#endif diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/netstandard/Tracing/PlatformEqtTrace.cs b/src/Microsoft.TestPlatform.PlatformAbstractions/netstandard/Tracing/PlatformEqtTrace.cs deleted file mode 100644 index 8dd37b469f..0000000000 --- a/src/Microsoft.TestPlatform.PlatformAbstractions/netstandard/Tracing/PlatformEqtTrace.cs +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -#if NETSTANDARD && !NETSTANDARD2_0 - -using System; -using System.Diagnostics; - -namespace Microsoft.VisualStudio.TestPlatform.ObjectModel; - -/// -/// Wrapper class for tracing. -/// - Shortcut-methods for Error, Warning, Info, Verbose. -/// - Adds additional information to the trace: calling process name, PID, ThreadID, Time. -/// - Uses custom switch EqtTraceLevel from .config file. -/// - By default tracing if OFF. -/// - Our build environment always sets the /d:TRACE so this class is always enabled, -/// the Debug class is enabled only in debug builds (/d:DEBUG). -/// - We ignore exceptions thrown by underlying TraceSwitch (e.g. due to config file error). -/// We log ignored exceptions to system Application log. -/// We pass through exceptions thrown due to incorrect arguments to EqtTrace methods. -/// Usage: EqtTrace.Info("Here's how to trace info"); -/// -public class PlatformEqtTrace : IPlatformEqtTrace -{ - private PlatformTraceLevel _traceLevel = PlatformTraceLevel.Off; - - public static string? ErrorOnInitialization { get; set; } - - public bool DoNotInitialize { get; set; } - - public void WriteLine(PlatformTraceLevel traceLevel, string? message) - { - if (!ShouldTrace(traceLevel)) - { - return; - } - - var level = Enum.GetName(typeof(PlatformTraceLevel), traceLevel); - - Debug.WriteLine($"[{level}] {message}"); - } - - public bool InitializeVerboseTrace(string? customLogFile) - { -#if DEBUG - // We don't have access to System.Diagnostics.Trace on netstandard1.3 - // so we write to Debug. No need to initialize for non-debug builds. - return true; -#else - return false; -#endif - } - - public bool InitializeTrace(string? customLogFile, PlatformTraceLevel traceLevel) - { - _traceLevel = traceLevel; - -#if DEBUG - // We don't have access to System.Diagnostics.Trace on netstandard1.3 - // so we write to Debug. No need to initialize for non-debug builds. - return true; -#else - return false; -#endif - } - - public bool ShouldTrace(PlatformTraceLevel traceLevel) - { - return !DoNotInitialize && (int)_traceLevel >= (int)traceLevel; - } - - public string? GetLogFile() => string.Empty; - - public void SetTraceLevel(PlatformTraceLevel value) - { - _traceLevel = value; - } - - public PlatformTraceLevel GetTraceLevel() => _traceLevel; -} - -#endif diff --git a/src/Microsoft.TestPlatform.Utilities/InferRunSettingsHelper.cs b/src/Microsoft.TestPlatform.Utilities/InferRunSettingsHelper.cs index a16f2b46d9..28239cb0de 100644 --- a/src/Microsoft.TestPlatform.Utilities/InferRunSettingsHelper.cs +++ b/src/Microsoft.TestPlatform.Utilities/InferRunSettingsHelper.cs @@ -702,12 +702,7 @@ private static bool IsPlatformIncompatible(Architecture sourcePlatform, Architec static bool Is64BitOperatingSystem() { -#if !NETSTANDARD1_3 return Environment.Is64BitOperatingSystem; -#else - // In the absence of APIs to check, assume the majority case - return true; -#endif } } diff --git a/src/Microsoft.TestPlatform.Utilities/Microsoft.TestPlatform.Utilities.csproj b/src/Microsoft.TestPlatform.Utilities/Microsoft.TestPlatform.Utilities.csproj index f481890916..271cdf21a6 100644 --- a/src/Microsoft.TestPlatform.Utilities/Microsoft.TestPlatform.Utilities.csproj +++ b/src/Microsoft.TestPlatform.Utilities/Microsoft.TestPlatform.Utilities.csproj @@ -6,7 +6,7 @@ Microsoft.TestPlatform.Utilities - netstandard2.0;netstandard1.3;$(TargetNetFxVersion) + netstandard2.0;$(TargetNetFxVersion) net6.0 false diff --git a/src/Microsoft.TestPlatform.Utilities/PublicAPI/netstandard1.3/PublicAPI.Shipped.txt b/src/Microsoft.TestPlatform.Utilities/PublicAPI/netstandard1.3/PublicAPI.Shipped.txt deleted file mode 100644 index 7dc5c58110..0000000000 --- a/src/Microsoft.TestPlatform.Utilities/PublicAPI/netstandard1.3/PublicAPI.Shipped.txt +++ /dev/null @@ -1 +0,0 @@ -#nullable enable diff --git a/src/Microsoft.TestPlatform.Utilities/PublicAPI/netstandard1.3/PublicAPI.Unshipped.txt b/src/Microsoft.TestPlatform.Utilities/PublicAPI/netstandard1.3/PublicAPI.Unshipped.txt deleted file mode 100644 index 7dc5c58110..0000000000 --- a/src/Microsoft.TestPlatform.Utilities/PublicAPI/netstandard1.3/PublicAPI.Unshipped.txt +++ /dev/null @@ -1 +0,0 @@ -#nullable enable diff --git a/src/package/nuspec/Microsoft.CodeCoverage.nuspec b/src/package/nuspec/Microsoft.CodeCoverage.nuspec index 29359c5377..001fa55ba9 100644 --- a/src/package/nuspec/Microsoft.CodeCoverage.nuspec +++ b/src/package/nuspec/Microsoft.CodeCoverage.nuspec @@ -29,66 +29,66 @@ - - - - - - - - - + + + + + + + + + - - - - - - + + + + + + - + - - - - + + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/src/package/nuspec/Microsoft.TestPlatform.AdapterUtilities.nuspec b/src/package/nuspec/Microsoft.TestPlatform.AdapterUtilities.nuspec index 99eed9ea98..22f9f0df97 100644 --- a/src/package/nuspec/Microsoft.TestPlatform.AdapterUtilities.nuspec +++ b/src/package/nuspec/Microsoft.TestPlatform.AdapterUtilities.nuspec @@ -22,17 +22,6 @@ commit="$CommitId$" /> - - - - - - - - - - - @@ -47,9 +36,6 @@ - - - diff --git a/src/package/nuspec/TestPlatform.Extensions.TrxLogger.nuspec b/src/package/nuspec/TestPlatform.Extensions.TrxLogger.nuspec index d7069eb693..e41d535e8b 100644 --- a/src/package/nuspec/TestPlatform.Extensions.TrxLogger.nuspec +++ b/src/package/nuspec/TestPlatform.Extensions.TrxLogger.nuspec @@ -24,13 +24,12 @@ - - - - + + + @@ -44,7 +43,7 @@ - + @@ -61,19 +60,19 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/src/package/nuspec/TestPlatform.Internal.Uwp.nuspec b/src/package/nuspec/TestPlatform.Internal.Uwp.nuspec index 8196ae77f4..cab44e1fbe 100644 --- a/src/package/nuspec/TestPlatform.Internal.Uwp.nuspec +++ b/src/package/nuspec/TestPlatform.Internal.Uwp.nuspec @@ -22,103 +22,103 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + diff --git a/src/package/nuspec/TestPlatform.ObjectModel.nuspec b/src/package/nuspec/TestPlatform.ObjectModel.nuspec index 094f9dafd5..8dbc8c2ae6 100644 --- a/src/package/nuspec/TestPlatform.ObjectModel.nuspec +++ b/src/package/nuspec/TestPlatform.ObjectModel.nuspec @@ -30,29 +30,6 @@ - - - - - - - - - - - - - - - - - - - - - - - @@ -129,74 +106,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/package/sign/sign.proj b/src/package/sign/sign.proj index 05c75b4bb2..e58d282922 100644 --- a/src/package/sign/sign.proj +++ b/src/package/sign/sign.proj @@ -24,12 +24,6 @@ $(ArtifactsBaseDirectory)netcoreapp3.1\ - - $(ArtifactsBaseDirectory)netstandard1.0\ - - - $(ArtifactsBaseDirectory)netstandard1.3\ - $(ArtifactsBaseDirectory)netstandard2.0\ @@ -198,19 +192,6 @@ - - - - - - - - - - - - - @@ -233,8 +214,6 @@ - - @@ -320,16 +299,6 @@ - - Microsoft400 - StrongName - - - - Microsoft400 - StrongName - - Microsoft400 StrongName @@ -386,18 +355,6 @@ IntermediatesDirectory="$(IntermediatesDirectory)" Type="$(SignType)" /> - - - - - - Date: Tue, 2 Aug 2022 15:13:11 +0200 Subject: [PATCH 2/2] Remove UAP --- scripts/build.ps1 | 45 +---- scripts/verify-nupkgs.ps1 | 10 +- shared/NullableAttributes.cs | 4 +- .../Helpers/ReflectionHelpers.MethodBase.cs | 30 --- .../Helpers/ReflectionHelpers.Type.cs | 8 - .../InvalidManagedNameException.cs | 13 +- .../ManagedNameHelper.Reflection.cs | 30 +-- ...osoft.TestPlatform.AdapterUtilities.csproj | 34 ---- .../PublicAPI/PublicAPI.Shipped.txt | 1 + .../PublicAPI/net/PublicAPI.Shipped.txt | 2 - .../PublicAPI/net/PublicAPI.Unshipped.txt | 1 - .../TestPluginDiscoverer.cs | 16 -- ...icrosoft.TestPlatform.CoreUtilities.csproj | 15 -- .../Output/ConsoleOutput.cs | 4 - .../Output/OutputExtensions.cs | 4 - .../Framework.cs | 9 +- .../Microsoft.TestPlatform.ObjectModel.csproj | 26 +-- .../Navigation/PortableSymbolReader.cs | 5 - .../TraitCollection.cs | 11 +- ...t.TestPlatform.PlatformAbstractions.csproj | 27 --- .../uap10.0/IO/PlatformStream.cs | 22 --- .../Runtime/PlatformAssemblyExtensions.cs | 30 --- .../Runtime/PlatformAssemblyLoadContext.cs | 30 --- .../Runtime/PlatformAssemblyResolver.cs | 39 ---- .../uap10.0/System/PlatformEnvironment.cs | 52 ----- .../uap10.0/System/PlatformThread.cs | 36 ---- .../uap10.0/System/ProcessHelper.cs | 113 ----------- .../uap10.0/Tracing/FileEventListener.cs | 95 --------- .../uap10.0/Tracing/PlatformEqtTrace.cs | 186 ------------------ .../uap10.0/Tracing/UnitTestEventSource.cs | 45 ----- .../nuspec/Microsoft.NET.Test.Sdk.nuspec | 10 - ...osoft.TestPlatform.AdapterUtilities.nuspec | 7 - .../nuspec/TestPlatform.Internal.Uwp.nuspec | 56 +----- .../nuspec/TestPlatform.ObjectModel.nuspec | 44 ----- .../nuspec/TestPlatform.TestHost.nuspec | 102 ---------- src/package/sign/sign.proj | 29 --- 36 files changed, 22 insertions(+), 1169 deletions(-) delete mode 100644 src/Microsoft.TestPlatform.AdapterUtilities/PublicAPI/net/PublicAPI.Shipped.txt delete mode 100644 src/Microsoft.TestPlatform.AdapterUtilities/PublicAPI/net/PublicAPI.Unshipped.txt delete mode 100644 src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/IO/PlatformStream.cs delete mode 100644 src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/Runtime/PlatformAssemblyExtensions.cs delete mode 100644 src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/Runtime/PlatformAssemblyLoadContext.cs delete mode 100644 src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/Runtime/PlatformAssemblyResolver.cs delete mode 100644 src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/System/PlatformEnvironment.cs delete mode 100644 src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/System/PlatformThread.cs delete mode 100644 src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/System/ProcessHelper.cs delete mode 100644 src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/Tracing/FileEventListener.cs delete mode 100644 src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/Tracing/PlatformEqtTrace.cs delete mode 100644 src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/Tracing/UnitTestEventSource.cs diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 97576cc23f..1cfc0492a8 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -83,7 +83,6 @@ $TPB_TargetFramework462 = "net462" $TPB_TargetFramework472 = "net472" $TPB_TargetFramework48 = "net48" $TPB_TargetFrameworkCore31 = "netcoreapp3.1" -$TPB_TargetFrameworkUap100 = "uap10.0" $TPB_TargetFrameworkNS20 = "netstandard2.0" $TPB_Configuration = $Configuration $TPB_TargetRuntime = $TargetRuntime @@ -419,7 +418,6 @@ function Publish-Package { $timer = Start-Timer Write-Log "Publish-Package: Started." $net462PackageDir = Get-FullCLR462PackageDirectory - $uap100PackageDir = $(Join-Path $env:TP_OUT_DIR "$TPB_Configuration\$TPB_TargetFrameworkUap100"); $netstandard20PackageDir = $(Join-Path $env:TP_OUT_DIR "$TPB_Configuration\$TPB_TargetFrameworkNS20"); $coreCLR31PackageDir = Get-CoreCLR31PackageDirectory $coreClrNetFrameworkTestHostDir = Join-Path $coreCLR31PackageDir "TestHostNetFramework" @@ -437,7 +435,6 @@ function Publish-Package { $testhostCore31PackageTempX86Dir = $(Join-Path $env:TP_OUT_DIR "$TPB_Configuration\publishTemp\Microsoft.TestPlatform.TestHost\$TPB_TargetFrameworkCore31\$TPB_X86_Runtime") $testhostCore31PackageTempARM64Dir = $(Join-Path $env:TP_OUT_DIR "$TPB_Configuration\publishTemp\Microsoft.TestPlatform.TestHost\$TPB_TargetFrameworkCore31\$TPB_ARM64_Runtime") - $testhostUapPackageDir = $(Join-Path $env:TP_OUT_DIR "$TPB_Configuration\Microsoft.TestPlatform.TestHost\$TPB_TargetFrameworkUap100") $vstestConsoleProject = Join-Path $env:TP_ROOT_DIR "src\vstest.console\vstest.console.csproj" $settingsMigratorProject = Join-Path $env:TP_ROOT_DIR "src\SettingsMigrator\SettingsMigrator.csproj" $dataCollectorProject = Join-Path $env:TP_ROOT_DIR "src\datacollector\datacollector.csproj" @@ -470,7 +467,6 @@ function Publish-Package { Write-Log "Package: Publish testhost\testhost.csproj" Publish-PackageInternal $testHostProject $TPB_TargetFramework462 $testhostFullPackageDir Publish-PackageInternal $testHostProject $TPB_TargetFrameworkCore31 $testhostCore31PackageDir - Publish-PackageInternal $testHostProject $TPB_TargetFrameworkCore31 $testhostUapPackageDir Publish-PackageWithRuntimeInternal $testHostProject $TPB_TargetFrameworkCore31 $TPB_X64_Runtime false $testhostCore31PackageTempX64Dir Write-Log "Package: Publish testhost.x86\testhost.x86.csproj" @@ -523,21 +519,11 @@ function Publish-Package { ################################################################################ # Publish Microsoft.TestPlatform.ObjectModel - - # Copy this first because for ObjectModel it puts platform abstractions NS1.3 version - # into the output folder (for some reason), and we overwrite it with actual uap10.0 version below - Copy-Bulk -root (Join-Path $env:TP_ROOT_DIR "src\Microsoft.TestPlatform.ObjectModel\bin\$TPB_Configuration") ` -files @{ $TPB_TargetFramework462 = $net462PackageDir # net462 $TPB_TargetFrameworkCore31 = $coreCLR31PackageDir # netcoreapp3.1 $TPB_TargetFrameworkNS20 = $netstandard20PackageDir # netstandard2_0 - $TPB_TargetFrameworkUap100 = $uap100PackageDir # uap10.0 - } - - Copy-Bulk -root (Join-Path $env:TP_ROOT_DIR "src\Microsoft.TestPlatform.ObjectModel\bin\$TPB_Configuration") ` - -files @{ - $TPB_TargetFrameworkUap100 = $testhostUapPackageDir # uap10.0 - testhost } ################################################################################ @@ -547,11 +533,6 @@ function Publish-Package { $TPB_TargetFramework462 = $net462PackageDir # net462 $TPB_TargetFrameworkCore31 = $coreCLR31PackageDir # netcoreapp3.1 $TPB_TargetFrameworkNS20 = $netstandard20PackageDir # netstandard2_0 - $TPB_TargetFrameworkUap100 = $uap100PackageDir # uap10.0 - } - Copy-Bulk -root (Join-Path $env:TP_ROOT_DIR "src\Microsoft.TestPlatform.PlatformAbstractions\bin\$TPB_Configuration") ` - -files @{ - $TPB_TargetFrameworkUap100 = $testhostUapPackageDir # uap10.0 - testhost } ################################################################################ @@ -560,12 +541,6 @@ function Publish-Package { -files @{ $TPB_TargetFramework462 = $net462PackageDir # net462 $TPB_TargetFrameworkNS20 = $netstandard20PackageDir # netstandard2_0 - $TPB_TargetFrameworkUap100 = $uap100PackageDir # uap10.0 - } - - Copy-Bulk -root (Join-Path $env:TP_ROOT_DIR "src\Microsoft.TestPlatform.CoreUtilities\bin\$TPB_Configuration") ` - -files @{ - $TPB_TargetFrameworkUap100 = $testhostUapPackageDir # uap10.0 - testhost } ################################################################################ @@ -574,7 +549,6 @@ function Publish-Package { -files @{ "$TPB_TargetFramework462/any" = $net462PackageDir # net462 $TPB_TargetFrameworkNS20 = $netstandard20PackageDir # netstandard2_0 - $TPB_TargetFrameworkUap100 = $uap100PackageDir # uap10.0 } ################################################################################ @@ -590,7 +564,6 @@ function Publish-Package { $comComponentsDirectory = Join-Path $env:TP_PACKAGES_DIR "Microsoft.Internal.Dia\$testPlatformMsDiaVersion\tools\net451" Copy-Item -Recurse $comComponentsDirectory\* $testhostCore31PackageDir -Force Copy-Item -Recurse $comComponentsDirectory\* $testhostFullPackageDir -Force - Copy-Item -Recurse $comComponentsDirectory\* $testhostUapPackageDir -Force Copy-Item -Recurse $comComponentsDirectory\* $coreClrNetFrameworkTestHostDir -Force # Copy over the logger assemblies to the Extensions folder. @@ -1015,11 +988,6 @@ function Create-NugetPackages { # Copy licenses folder Copy-Item (Join-Path $env:TP_PACKAGE_PROJ_DIR "licenses") $stagingDir -Force -Recurse - # Copy Uap target, & props - $testhostUapPackageDir = $(Join-Path $env:TP_OUT_DIR "$TPB_Configuration\Microsoft.TestPlatform.TestHost\$TPB_TargetFrameworkUap100") - Copy-Item $tpNuspecDir\uap\"Microsoft.TestPlatform.TestHost.Uap.props" $testhostUapPackageDir\Microsoft.TestPlatform.TestHost.props -Force - Copy-Item $tpNuspecDir\uap\"Microsoft.TestPlatform.TestHost.Uap.targets" $testhostUapPackageDir\Microsoft.TestPlatform.TestHost.targets -Force - $testhostCore31PackageDir = $(Join-Path $env:TP_OUT_DIR "$TPB_Configuration\Microsoft.TestPlatform.TestHost\$TPB_TargetFrameworkCore31") Copy-Item $tpNuspecDir\"Microsoft.TestPlatform.TestHost.NetCore.props" $testhostCore31PackageDir\Microsoft.TestPlatform.TestHost.props -Force @@ -1034,8 +1002,6 @@ function Create-NugetPackages { $microsoftFakesVersion = ([xml](Get-Content $env:TP_ROOT_DIR\scripts\build\TestPlatform.Dependencies.props)).Project.PropertyGroup.MicrosoftFakesVersion $FakesPackageDir = Join-Path $env:TP_PACKAGES_DIR "Microsoft.QualityTools.Testing.Fakes.TestRunnerHarness\$microsoftFakesVersion\contentFiles" - $uap100PackageDir = $(Join-Path $env:TP_OUT_DIR "$TPB_Configuration\$TPB_TargetFrameworkUap100"); - # package them from stagingDir foreach ($file in $nuspecFiles) { $additionalArgs = "" @@ -1043,16 +1009,7 @@ function Create-NugetPackages { $additionalArgs = "-NoPackageAnalysis" } - if ($file -eq "TestPlatform.Internal.Uwp.nuspec") { - # this directory is mostly the same as the testhost10 dir, but has less libraries - # and does not have netstandard2.0 versions, so I don't copy them by mistake - $uap10Nuget = $uap100PackageDir - } - else { - $uap10Nuget = $testhostUapPackageDir - } - - Invoke-Exe $nugetExe -Arguments "pack $stagingDir\$file -OutputDirectory $packageOutputDir -Version $TPB_Version -Properties Version=$TPB_Version;JsonNetVersion=$JsonNetVersion;Runtime=$TPB_TargetRuntime;NetCoreTargetFramework=$TPB_TargetFrameworkCore31;FakesPackageDir=$FakesPackageDir;NetStandard20Framework=$TPB_TargetFrameworkNS20;Uap10Framework=$uap10Nuget;BranchName=$TPB_BRANCH;CommitId=$TPB_COMMIT $additionalArgs" + Invoke-Exe $nugetExe -Arguments "pack $stagingDir\$file -OutputDirectory $packageOutputDir -Version $TPB_Version -Properties Version=$TPB_Version;JsonNetVersion=$JsonNetVersion;Runtime=$TPB_TargetRuntime;NetCoreTargetFramework=$TPB_TargetFrameworkCore31;FakesPackageDir=$FakesPackageDir;NetStandard20Framework=$TPB_TargetFrameworkNS20;BranchName=$TPB_BRANCH;CommitId=$TPB_COMMIT $additionalArgs" } foreach ($file in $projectFiles) { diff --git a/scripts/verify-nupkgs.ps1 b/scripts/verify-nupkgs.ps1 index dde9eb1ca1..ffa386ee9b 100644 --- a/scripts/verify-nupkgs.ps1 +++ b/scripts/verify-nupkgs.ps1 @@ -13,17 +13,17 @@ function Verify-Nuget-Packages($packageDirectory, $version) Write-Log "Starting Verify-Nuget-Packages." $expectedNumOfFiles = @{ "Microsoft.CodeCoverage" = 57; - "Microsoft.NET.Test.Sdk" = 18; + "Microsoft.NET.Test.Sdk" = 16; "Microsoft.TestPlatform" = 607; "Microsoft.TestPlatform.Build" = 21; "Microsoft.TestPlatform.CLI" = 499; "Microsoft.TestPlatform.Extensions.TrxLogger" = 35; - "Microsoft.TestPlatform.ObjectModel" = 180; - "Microsoft.TestPlatform.AdapterUtilities" = 62; + "Microsoft.TestPlatform.ObjectModel" = 93; + "Microsoft.TestPlatform.AdapterUtilities" = 34; "Microsoft.TestPlatform.Portable" = 597; - "Microsoft.TestPlatform.TestHost" = 153; + "Microsoft.TestPlatform.TestHost" = 63; "Microsoft.TestPlatform.TranslationLayer" = 123; - "Microsoft.TestPlatform.Internal.Uwp" = 86; + "Microsoft.TestPlatform.Internal.Uwp" = 46; } $nugetPackages = Get-ChildItem -Filter "*$version*.nupkg" $packageDirectory | % { $_.FullName } diff --git a/shared/NullableAttributes.cs b/shared/NullableAttributes.cs index 0879edb7f6..64e73a48dd 100644 --- a/shared/NullableAttributes.cs +++ b/shared/NullableAttributes.cs @@ -8,7 +8,7 @@ namespace System.Diagnostics.CodeAnalysis; -#if NETFRAMEWORK || WINDOWS_UWP || NETSTANDARD && !NETSTANDARD2_1 || NETCOREAPP && !NETCOREAPP3_0_OR_GREATER +#if NETFRAMEWORK || NETSTANDARD && !NETSTANDARD2_1 || NETCOREAPP && !NETCOREAPP3_0_OR_GREATER /// Specifies that null is allowed as an input even if the corresponding type disallows it. [AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property, Inherited = false)] @@ -89,7 +89,7 @@ internal sealed class DoesNotReturnIfAttribute : Attribute #endif -#if NETFRAMEWORK || WINDOWS_UWP || NETSTANDARD && !NETSTANDARD2_1 || NETCOREAPP && !NET5_0_OR_GREATER +#if NETFRAMEWORK || NETSTANDARD && !NETSTANDARD2_1 || NETCOREAPP && !NET5_0_OR_GREATER /// Specifies that the method or property will ensure that the listed field and property members have not-null values. [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)] diff --git a/src/Microsoft.TestPlatform.AdapterUtilities/Helpers/ReflectionHelpers.MethodBase.cs b/src/Microsoft.TestPlatform.AdapterUtilities/Helpers/ReflectionHelpers.MethodBase.cs index b4098b11f2..8a65ff0c20 100644 --- a/src/Microsoft.TestPlatform.AdapterUtilities/Helpers/ReflectionHelpers.MethodBase.cs +++ b/src/Microsoft.TestPlatform.AdapterUtilities/Helpers/ReflectionHelpers.MethodBase.cs @@ -8,48 +8,18 @@ namespace Microsoft.TestPlatform.AdapterUtilities.Helpers; internal static partial class ReflectionHelpers { -#if WINDOWS_UWP - private static readonly Type MethodBase = typeof(MethodBase); - - private const string MemberTypePropertyName = "MemberType"; - private const string ReflectedTypePropertyName = "ReflectedType"; - private const string MethodHandlePropertyName = "MethodHandle"; - - private static readonly PropertyInfo MemberTypeProperty = MethodBase.GetRuntimeProperty(MemberTypePropertyName); - private static readonly PropertyInfo ReflectedTypeProperty = MethodBase.GetRuntimeProperty(ReflectedTypePropertyName); - private static readonly PropertyInfo MethodHandleProperty = MethodBase.GetRuntimeProperty(MethodHandlePropertyName); -#endif - internal static bool IsMethod(MethodBase method) { -#if !WINDOWS_UWP return method.MemberType == MemberTypes.Method; -#else - AssertSupport(MemberTypeProperty, MemberTypePropertyName, MethodBase.FullName); - - return (int)MemberTypeProperty.GetValue(method) == 8; -#endif } internal static Type? GetReflectedType(MethodBase method) { -#if !WINDOWS_UWP return method.ReflectedType; -#else - AssertSupport(MemberTypeProperty, ReflectedTypePropertyName, MethodBase.FullName); - - return ReflectedTypeProperty.GetValue(method) as Type; -#endif } internal static RuntimeMethodHandle GetMethodHandle(MethodBase method) { -#if !WINDOWS_UWP return method.MethodHandle; -#else - AssertSupport(MemberTypeProperty, MethodHandlePropertyName, MethodBase.FullName); - - return (RuntimeMethodHandle)MethodHandleProperty.GetValue(method); -#endif } } diff --git a/src/Microsoft.TestPlatform.AdapterUtilities/Helpers/ReflectionHelpers.Type.cs b/src/Microsoft.TestPlatform.AdapterUtilities/Helpers/ReflectionHelpers.Type.cs index 17e0ea5330..2faf43ccb2 100644 --- a/src/Microsoft.TestPlatform.AdapterUtilities/Helpers/ReflectionHelpers.Type.cs +++ b/src/Microsoft.TestPlatform.AdapterUtilities/Helpers/ReflectionHelpers.Type.cs @@ -10,19 +10,11 @@ internal static partial class ReflectionHelpers { internal static bool IsGenericType(Type type) { -#if !WINDOWS_UWP return type.IsGenericType; -#else - return type.GetTypeInfo().IsGenericType; -#endif } internal static MethodBase? GetDeclaringMethod(Type type) { -#if !WINDOWS_UWP return type.DeclaringMethod; -#else - return type.GetTypeInfo().DeclaringMethod; -#endif } } diff --git a/src/Microsoft.TestPlatform.AdapterUtilities/ManagedNameUtilities/InvalidManagedNameException.cs b/src/Microsoft.TestPlatform.AdapterUtilities/ManagedNameUtilities/InvalidManagedNameException.cs index a06e7ab539..78b6d36363 100644 --- a/src/Microsoft.TestPlatform.AdapterUtilities/ManagedNameUtilities/InvalidManagedNameException.cs +++ b/src/Microsoft.TestPlatform.AdapterUtilities/ManagedNameUtilities/InvalidManagedNameException.cs @@ -2,25 +2,14 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; - -#if !WINDOWS_UWP using System.Runtime.Serialization; -#endif namespace Microsoft.TestPlatform.AdapterUtilities.ManagedNameUtilities; -#if !WINDOWS_UWP [Serializable] -#endif -public class InvalidManagedNameException : - Exception -#if !WINDOWS_UWP - , ISerializable -#endif +public class InvalidManagedNameException : Exception, ISerializable { public InvalidManagedNameException(string? message) : base(message) { } -#if !WINDOWS_UWP protected InvalidManagedNameException(SerializationInfo info, StreamingContext context) : base(info, context) { } -#endif } diff --git a/src/Microsoft.TestPlatform.AdapterUtilities/ManagedNameUtilities/ManagedNameHelper.Reflection.cs b/src/Microsoft.TestPlatform.AdapterUtilities/ManagedNameUtilities/ManagedNameHelper.Reflection.cs index 2445ffeda5..1066730e5b 100644 --- a/src/Microsoft.TestPlatform.AdapterUtilities/ManagedNameUtilities/ManagedNameHelper.Reflection.cs +++ b/src/Microsoft.TestPlatform.AdapterUtilities/ManagedNameUtilities/ManagedNameHelper.Reflection.cs @@ -227,19 +227,7 @@ public static MethodBase GetMethod(Assembly assembly, string managedTypeName, st Type? type; var parsedManagedTypeName = ReflectionHelpers.ParseEscapedString(managedTypeName); - -#if !WINDOWS_UWP type = assembly.GetType(parsedManagedTypeName, throwOnError: false, ignoreCase: false); -#else - try - { - type = assembly.GetType(parsedManagedTypeName); - } - catch - { - type = null; - } -#endif if (type == null) { @@ -297,12 +285,8 @@ bool Filter(MemberInfo mbr, object? param) MemberInfo[] methods; -#if !WINDOWS_UWP var bindingFlags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static; methods = type.FindMembers(MemberTypes.Method, bindingFlags, Filter, null); -#else - methods = type.GetRuntimeMethods().Where(m => Filter(m, null)).ToArray(); -#endif return (MethodInfo?)(methods.Length switch { @@ -500,23 +484,13 @@ private static int AppendNestedTypeName(StringBuilder b, Type? type, bool closed private static void AppendGenericMethodParameters(StringBuilder methodBuilder, MethodBase method) { - Type[] genericArguments; - - genericArguments = method.GetGenericArguments(); - + Type[] genericArguments = method.GetGenericArguments(); AppendGenericArguments(methodBuilder, genericArguments); } private static void AppendGenericTypeParameters(StringBuilder b, Type type) { - Type[] genericArguments; - -#if !WINDOWS_UWP - genericArguments = type.GetGenericArguments(); -#else - genericArguments = type.GetTypeInfo().GenericTypeArguments; -#endif - + Type[] genericArguments = type.GetGenericArguments(); AppendGenericArguments(b, genericArguments); } diff --git a/src/Microsoft.TestPlatform.AdapterUtilities/Microsoft.TestPlatform.AdapterUtilities.csproj b/src/Microsoft.TestPlatform.AdapterUtilities/Microsoft.TestPlatform.AdapterUtilities.csproj index f3256d8c86..c0e44807a5 100644 --- a/src/Microsoft.TestPlatform.AdapterUtilities/Microsoft.TestPlatform.AdapterUtilities.csproj +++ b/src/Microsoft.TestPlatform.AdapterUtilities/Microsoft.TestPlatform.AdapterUtilities.csproj @@ -6,47 +6,16 @@ netstandard2.0;$(TargetNetFxVersion) - $(TargetFrameworks);uap10.0 net6.0 Microsoft.TestPlatform.AdapterUtilities Microsoft.TestPlatform.AdapterUtilities - - false - UAP,Version=v10.0 - UAP - 10.0.14393.0 - 10.0.10240.0 - .NETPortable - v4.5 - $(DefineConstants);WINDOWS_UWP - - - .NETFramework - v4.6.2 - false - - any false - - - - - - - - - - - - - - @@ -71,9 +40,6 @@ - - - diff --git a/src/Microsoft.TestPlatform.AdapterUtilities/PublicAPI/PublicAPI.Shipped.txt b/src/Microsoft.TestPlatform.AdapterUtilities/PublicAPI/PublicAPI.Shipped.txt index f8e730f6cf..a758469bac 100644 --- a/src/Microsoft.TestPlatform.AdapterUtilities/PublicAPI/PublicAPI.Shipped.txt +++ b/src/Microsoft.TestPlatform.AdapterUtilities/PublicAPI/PublicAPI.Shipped.txt @@ -15,6 +15,7 @@ Microsoft.TestPlatform.AdapterUtilities.HierarchyConstants.Levels Microsoft.TestPlatform.AdapterUtilities.ManagedNameConstants Microsoft.TestPlatform.AdapterUtilities.ManagedNameUtilities.InvalidManagedNameException Microsoft.TestPlatform.AdapterUtilities.ManagedNameUtilities.InvalidManagedNameException.InvalidManagedNameException(string? message) -> void +Microsoft.TestPlatform.AdapterUtilities.ManagedNameUtilities.InvalidManagedNameException.InvalidManagedNameException(System.Runtime.Serialization.SerializationInfo! info, System.Runtime.Serialization.StreamingContext context) -> void Microsoft.TestPlatform.AdapterUtilities.ManagedNameUtilities.ManagedNameHelper Microsoft.TestPlatform.AdapterUtilities.ManagedNameUtilities.ManagedNameParser Microsoft.TestPlatform.AdapterUtilities.ManagedNameUtilities.ManagedNameParser.ManagedNameParser() -> void diff --git a/src/Microsoft.TestPlatform.AdapterUtilities/PublicAPI/net/PublicAPI.Shipped.txt b/src/Microsoft.TestPlatform.AdapterUtilities/PublicAPI/net/PublicAPI.Shipped.txt deleted file mode 100644 index 894dded7e9..0000000000 --- a/src/Microsoft.TestPlatform.AdapterUtilities/PublicAPI/net/PublicAPI.Shipped.txt +++ /dev/null @@ -1,2 +0,0 @@ -#nullable enable -Microsoft.TestPlatform.AdapterUtilities.ManagedNameUtilities.InvalidManagedNameException.InvalidManagedNameException(System.Runtime.Serialization.SerializationInfo! info, System.Runtime.Serialization.StreamingContext context) -> void diff --git a/src/Microsoft.TestPlatform.AdapterUtilities/PublicAPI/net/PublicAPI.Unshipped.txt b/src/Microsoft.TestPlatform.AdapterUtilities/PublicAPI/net/PublicAPI.Unshipped.txt deleted file mode 100644 index 7dc5c58110..0000000000 --- a/src/Microsoft.TestPlatform.AdapterUtilities/PublicAPI/net/PublicAPI.Unshipped.txt +++ /dev/null @@ -1 +0,0 @@ -#nullable enable diff --git a/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginDiscoverer.cs b/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginDiscoverer.cs index 795b0b18a2..205b45b09b 100644 --- a/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginDiscoverer.cs +++ b/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginDiscoverer.cs @@ -25,22 +25,6 @@ internal static class TestPluginDiscoverer { private static readonly HashSet UnloadableFiles = new(); -#if WINDOWS_UAP - private static HashSet platformAssemblies = new HashSet(new string[] { - "MICROSOFT.VISUALSTUDIO.TESTPLATFORM.UNITTESTFRAMEWORK.DLL", - "MICROSOFT.VISUALSTUDIO.TESTPLATFORM.TESTEXECUTOR.CORE.DLL", - "MICROSOFT.VISUALSTUDIO.TESTPLATFORM.OBJECTMODEL.DLL", - "VSTEST_EXECUTIONENGINE_PLATFORMBRIDGE.DLL", - "VSTEST_EXECUTIONENGINE_PLATFORMBRIDGE.WINMD", - "VSTEST.EXECUTIONENGINE.WINDOWSPHONE.DLL", - "MICROSOFT.CSHARP.DLL", - "MICROSOFT.VISUALBASIC.DLL", - "CLRCOMPRESSION.DLL", - }); - - private const string SYSTEM_ASSEMBLY_PREFIX = "system."; -#endif - /// /// Gets information about each of the test extensions available. /// diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Microsoft.TestPlatform.CoreUtilities.csproj b/src/Microsoft.TestPlatform.CoreUtilities/Microsoft.TestPlatform.CoreUtilities.csproj index 0d4f3914f7..a7f4acaf91 100644 --- a/src/Microsoft.TestPlatform.CoreUtilities/Microsoft.TestPlatform.CoreUtilities.csproj +++ b/src/Microsoft.TestPlatform.CoreUtilities/Microsoft.TestPlatform.CoreUtilities.csproj @@ -7,24 +7,9 @@ Microsoft.TestPlatform.CoreUtilities $(TargetNetFxVersion);$(TargetNetCoreVersion);netstandard2.0;net6.0 - $(TargetFrameworks);uap10.0 net6.0 false - - false - UAP,Version=v10.0 - UAP - 10.0.14393.0 - 10.0.10240.0 - .NETPortable - v4.5 - $(DefineConstants);WINDOWS_UWP - - - .NETFramework - v4.6.2 - diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Output/ConsoleOutput.cs b/src/Microsoft.TestPlatform.CoreUtilities/Output/ConsoleOutput.cs index c1952c5e98..79493af133 100644 --- a/src/Microsoft.TestPlatform.CoreUtilities/Output/ConsoleOutput.cs +++ b/src/Microsoft.TestPlatform.CoreUtilities/Output/ConsoleOutput.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -#if !WINDOWS_UWP - using System; using System.IO; @@ -84,5 +82,3 @@ public void Write(string? message, OutputLevel level) } } } - -#endif diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Output/OutputExtensions.cs b/src/Microsoft.TestPlatform.CoreUtilities/Output/OutputExtensions.cs index c0bd65e275..4e3cfbdc93 100644 --- a/src/Microsoft.TestPlatform.CoreUtilities/Output/OutputExtensions.cs +++ b/src/Microsoft.TestPlatform.CoreUtilities/Output/OutputExtensions.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -#if !WINDOWS_UWP - using System; using System.Globalization; @@ -130,5 +128,3 @@ private static void SetColorForAction(ConsoleColor foregroundColor, Action actio } } } - -#endif diff --git a/src/Microsoft.TestPlatform.ObjectModel/Framework.cs b/src/Microsoft.TestPlatform.ObjectModel/Framework.cs index 1311c6ce8a..9e3b8fe100 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Framework.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Framework.cs @@ -3,9 +3,7 @@ using Microsoft.VisualStudio.TestPlatform.CoreUtilities; -#if !WINDOWS_UWP using System.Globalization; -#endif using NuGet.Frameworks; @@ -60,12 +58,7 @@ private Framework() { // IDE always sends framework in form of ENUM, which always throws exception // This throws up in first chance exception, refer Bug https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_workitems/edit/591142 - var formattedFrameworkString = frameworkString.Trim() - .ToLower( -#if !WINDOWS_UWP - CultureInfo.InvariantCulture -#endif - ); + var formattedFrameworkString = frameworkString.Trim().ToLower(CultureInfo.InvariantCulture); switch (formattedFrameworkString) { case "framework35": diff --git a/src/Microsoft.TestPlatform.ObjectModel/Microsoft.TestPlatform.ObjectModel.csproj b/src/Microsoft.TestPlatform.ObjectModel/Microsoft.TestPlatform.ObjectModel.csproj index f3aa827767..0464996fcb 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Microsoft.TestPlatform.ObjectModel.csproj +++ b/src/Microsoft.TestPlatform.ObjectModel/Microsoft.TestPlatform.ObjectModel.csproj @@ -4,24 +4,14 @@ ..\..\ + Microsoft.VisualStudio.TestPlatform.ObjectModel $(TargetNetFxVersion);$(TargetNetCoreVersion);netstandard2.0 - $(TargetFrameworks);uap10.0 net6.0 Microsoft.TestPlatform.ObjectModel - - false - UAP,Version=v10.0 - UAP - 10.0.14393.0 - 10.0.10240.0 - .NETPortable - v4.5 - false - $(DefineConstants);WINDOWS_UWP - + @@ -35,21 +25,11 @@ - + - - - - - - - - - - diff --git a/src/Microsoft.TestPlatform.ObjectModel/Navigation/PortableSymbolReader.cs b/src/Microsoft.TestPlatform.ObjectModel/Navigation/PortableSymbolReader.cs index 643c6023d2..983e7fa3cd 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Navigation/PortableSymbolReader.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Navigation/PortableSymbolReader.cs @@ -103,13 +103,8 @@ private void PopulateCacheForTypeAndMethodSymbols(string binaryPath) } catch (FileNotFoundException) { -#if !WINDOWS_UWP // fallback when the assembly is not loaded asm = Assembly.LoadFile(binaryPath); -#else - // fallback is not supported - throw; -#endif } foreach (var type in asm.GetTypes()) diff --git a/src/Microsoft.TestPlatform.ObjectModel/TraitCollection.cs b/src/Microsoft.TestPlatform.ObjectModel/TraitCollection.cs index b4cb4e641e..6a886d3fb2 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/TraitCollection.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/TraitCollection.cs @@ -11,7 +11,7 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel; /// /// Class that holds collection of traits /// -#if NETFRAMEWORK +#if NETFRAMEWORK // REVIEW ME: This could be enabled for netcore and netstandard [Serializable] #endif public class TraitCollection : IEnumerable @@ -19,20 +19,15 @@ public class TraitCollection : IEnumerable internal const string TraitPropertyId = "TestObject.Traits"; private static readonly TestProperty TraitsProperty = TestProperty.Register( TraitPropertyId, -#if WINDOWS_UWP - // TODO: Fix this with proper resourcing for UWP and Win 8.1 Apps - // Trying to access resources will throw "MissingManifestResourceException" percolated as "TypeInitialization" exception - "Traits", -#else + // REVIEW ME: We should make some test to see if that's causing any crash on WinUI/UWP Resources.Resources.TestCasePropertyTraitsLabel, -#endif typeof(KeyValuePair[]), #pragma warning disable 618 TestPropertyAttributes.Hidden | TestPropertyAttributes.Trait, #pragma warning restore 618 typeof(TestObject)); -#if NETFRAMEWORK +#if NETFRAMEWORK // REVIEW ME: This could be enabled for netcore and netstandard [NonSerialized] #endif private readonly TestObject _testObject; diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/Microsoft.TestPlatform.PlatformAbstractions.csproj b/src/Microsoft.TestPlatform.PlatformAbstractions/Microsoft.TestPlatform.PlatformAbstractions.csproj index 0e45ee6ab2..60907b8ca2 100644 --- a/src/Microsoft.TestPlatform.PlatformAbstractions/Microsoft.TestPlatform.PlatformAbstractions.csproj +++ b/src/Microsoft.TestPlatform.PlatformAbstractions/Microsoft.TestPlatform.PlatformAbstractions.csproj @@ -8,23 +8,11 @@ Microsoft.TestPlatform.PlatformAbstractions Microsoft.TestPlatform.PlatformAbstractions $(TargetNetFxVersion);$(TargetNetCoreVersion);netstandard2.0;net6.0 - $(TargetFrameworks);uap10.0 net6.0 false $(NoWarn);NU1605 - - false - UAP,Version=v10.0 - UAP - 10.0.14393.0 - 10.0.10240.0 - .NETPortable - v4.5 - $(DefineConstants);WINDOWS_UWP - - @@ -41,21 +29,6 @@ - - - - - - - - - - - - - - - diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/IO/PlatformStream.cs b/src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/IO/PlatformStream.cs deleted file mode 100644 index a854028d62..0000000000 --- a/src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/IO/PlatformStream.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -#if WINDOWS_UWP - -using System.IO; - -using Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.Interfaces; - -namespace Microsoft.VisualStudio.TestPlatform.PlatformAbstractions; - -/// -public class PlatformStream : IStream -{ - /// - public Stream CreateBufferedStream(Stream stream, int bufferSize) - { - return stream; - } -} - -#endif diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/Runtime/PlatformAssemblyExtensions.cs b/src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/Runtime/PlatformAssemblyExtensions.cs deleted file mode 100644 index 1db7507c0d..0000000000 --- a/src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/Runtime/PlatformAssemblyExtensions.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -#if WINDOWS_UWP - -using System.Diagnostics.CodeAnalysis; -using System.IO; -using System.Reflection; - -namespace Microsoft.VisualStudio.TestPlatform.PlatformAbstractions; - -/// -/// Assembly Extensions -/// -public static class PlatformAssemblyExtensions -{ - /// - /// Get current assembly location as per current platform - /// - /// Assembly - /// Returns Assembly location as per platform - [SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Part of the public API")] - public static string GetAssemblyLocation(this Assembly assembly) - { - // In UWP all assemblies are packages inside Appx folder, so we return location of current directory - return Directory.GetCurrentDirectory(); - } -} - -#endif diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/Runtime/PlatformAssemblyLoadContext.cs b/src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/Runtime/PlatformAssemblyLoadContext.cs deleted file mode 100644 index 291734160e..0000000000 --- a/src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/Runtime/PlatformAssemblyLoadContext.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -#if WINDOWS_UWP - -using System.IO; -using System.Reflection; - -using Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.Interfaces; - -namespace Microsoft.VisualStudio.TestPlatform.PlatformAbstractions; - -/// -public class PlatformAssemblyLoadContext : IAssemblyLoadContext -{ - /// - public AssemblyName GetAssemblyNameFromPath(string assemblyPath) - { - string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(assemblyPath); - return new AssemblyName(fileNameWithoutExtension); - } - - /// - public Assembly LoadAssemblyFromPath(string assemblyPath) - { - return Assembly.Load(GetAssemblyNameFromPath(assemblyPath)); - } -} - -#endif diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/Runtime/PlatformAssemblyResolver.cs b/src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/Runtime/PlatformAssemblyResolver.cs deleted file mode 100644 index b2a4c3aa0f..0000000000 --- a/src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/Runtime/PlatformAssemblyResolver.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -#if WINDOWS_UWP - -using System; - -using Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.Interfaces; - -namespace Microsoft.VisualStudio.TestPlatform.PlatformAbstractions; - -/// -public class PlatformAssemblyResolver : IAssemblyResolver -{ - public PlatformAssemblyResolver() - { - } - - /// - public event AssemblyResolveEventHandler? AssemblyResolve; - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - protected virtual void Dispose(bool disposing) - { - } - - private void DummyEventThrower() - { - // need to raise this event, else compiler throws error - AssemblyResolve?.Invoke(this, null); - } -} - -#endif diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/System/PlatformEnvironment.cs b/src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/System/PlatformEnvironment.cs deleted file mode 100644 index 9c53b9b678..0000000000 --- a/src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/System/PlatformEnvironment.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -#if WINDOWS_UWP - -using System; -using System.Runtime.InteropServices; - -using Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.Interfaces; - -namespace Microsoft.VisualStudio.TestPlatform.PlatformAbstractions; - -/// -public class PlatformEnvironment : IEnvironment -{ - /// - public PlatformArchitecture Architecture - => RuntimeInformation.OSArchitecture switch - { - System.Runtime.InteropServices.Architecture.X86 => PlatformArchitecture.X86, - System.Runtime.InteropServices.Architecture.X64 => PlatformArchitecture.X64, - System.Runtime.InteropServices.Architecture.Arm => PlatformArchitecture.ARM, - System.Runtime.InteropServices.Architecture.Arm64 => PlatformArchitecture.ARM64, - _ => throw new NotSupportedException(), - }; - - /// - public PlatformOperatingSystem OperatingSystem - => RuntimeInformation.IsOSPlatform(OSPlatform.Windows) - ? PlatformOperatingSystem.Windows - : PlatformOperatingSystem.Unix; - - /// - public string OperatingSystemVersion => RuntimeInformation.OSDescription; - - /// - public int ProcessorCount => Environment.ProcessorCount; - - /// - public void Exit(int exitcode) - { - Environment.FailFast("Process terminating with exit code: " + exitcode); - } - - /// - public int GetCurrentManagedThreadId() - { - return Environment.CurrentManagedThreadId; - } -} - -#endif diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/System/PlatformThread.cs b/src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/System/PlatformThread.cs deleted file mode 100644 index d43b6fb32a..0000000000 --- a/src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/System/PlatformThread.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -#if WINDOWS_UWP - -using System; -using System.Threading.Tasks; - -using Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.Interfaces; - -namespace Microsoft.VisualStudio.TestPlatform.PlatformAbstractions; - -public class PlatformThread : IThread -{ - /// - public void Run(Action? action, PlatformApartmentState apartmentState, bool waitForCompletion) - { - if (apartmentState == PlatformApartmentState.STA) - { - throw new ThreadApartmentStateNotSupportedException(); - } - - if (action == null) - { - return; - } - - Task task = Task.Run(action); - if (waitForCompletion) - { - task.Wait(); - } - } -} - -#endif diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/System/ProcessHelper.cs b/src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/System/ProcessHelper.cs deleted file mode 100644 index 4661959451..0000000000 --- a/src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/System/ProcessHelper.cs +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -#if WINDOWS_UWP - -using System; -using System.Collections.Generic; -using System.IO; - -using Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.Interfaces; - -namespace Microsoft.VisualStudio.TestPlatform.PlatformAbstractions; - -/// -/// Helper class to deal with process related functionality. -/// -public partial class ProcessHelper : IProcessHelper -{ - /// - public object LaunchProcess(string processPath, string? arguments, string? workingDirectory, IDictionary? envVariables, Action? errorCallback, Action? exitCallBack, Action? outputCallBack) - { - throw new NotImplementedException(); - } - - /// - public string? GetCurrentProcessFileName() - { - throw new NotImplementedException(); - } - - /// - public string GetCurrentProcessLocation() - { - return Directory.GetCurrentDirectory(); - } - - /// - public string? GetTestEngineDirectory() - { - throw new NotImplementedException(); - } - - /// - public int GetCurrentProcessId() - { - return -1; - } - - /// - public string GetProcessName(int processId) - { - return string.Empty; - } - - /// - public bool TryGetExitCode(object? process, out int exitCode) - { - throw new NotImplementedException(); - } - - /// - public void SetExitCallback(int parentProcessId, Action? callbackAction) - { - } - - /// - public void TerminateProcess(object? process) - { - throw new NotImplementedException(); - } - - /// - public int GetProcessId(object? process) - { - return -1; - } - - /// - public PlatformArchitecture GetCurrentProcessArchitecture() - { - return IntPtr.Size == 8 ? PlatformArchitecture.X64 : PlatformArchitecture.X86; - } - - /// - public string GetNativeDllDirectory() - { - // For UWP the native dll's are to be kept in same directory - return GetCurrentProcessLocation(); - } - - /// - public void WaitForProcessExit(object? process) - { - throw new NotImplementedException(); - } - - public IntPtr GetProcessHandle(int processId) - { - throw new NotImplementedException(); - } - - public object GetProcessById(int processId) - { - throw new NotImplementedException(); - } - - public PlatformArchitecture GetProcessArchitecture(int processId) - { - throw new NotImplementedException(); - } -} - -#endif diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/Tracing/FileEventListener.cs b/src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/Tracing/FileEventListener.cs deleted file mode 100644 index a2a74cc1cc..0000000000 --- a/src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/Tracing/FileEventListener.cs +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -#if WINDOWS_UWP - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Diagnostics.Tracing; -using System.Globalization; -using System.IO; -using System.Threading; -using System.Threading.Tasks; - -namespace Microsoft.VisualStudio.TestPlatform.ObjectModel; - -internal sealed class FileEventListener : EventListener -{ - /// - /// Storage file to be used to write logs - /// - private readonly FileStream _fileStream; - - /// - /// StreamWriter to write logs to file - /// - private readonly StreamWriter _streamWriter; - - /// - /// Name of the current log file - /// - private readonly string _fileName; - - /// - /// The format to be used by logging. - /// - private readonly string _format = "{0:yyyy-MM-dd HH\\:mm\\:ss\\:ffff}\tType: {1}\tId: {2}\tMessage: '{3}'"; - - private readonly SemaphoreSlim _semaphoreSlim = new(1); - - public FileEventListener(string name) - { - _fileName = name; - - _fileStream = new FileStream(_fileName, FileMode.Append | FileMode.OpenOrCreate); - _streamWriter = new StreamWriter(_fileStream) - { - AutoFlush = true - }; - } - - protected override void OnEventWritten(EventWrittenEventArgs eventData) - { - if (_streamWriter == null) - { - return; - } - - var lines = new List(); - - var newFormatedLine = string.Format(CultureInfo.CurrentCulture, _format, DateTime.Now, eventData.Level, eventData.EventId, eventData.Payload[0]); - - Debug.WriteLine(newFormatedLine); - - lines.Add(newFormatedLine); - - WriteToFile(lines); - } - - private async void WriteToFile(IEnumerable lines) - { - await _semaphoreSlim.WaitAsync(); - - await Task.Run(async () => - { - try - { - foreach (var line in lines) - { - await _streamWriter.WriteLineAsync(line); - } - } - catch (Exception) - { - // Ignore - } - finally - { - _semaphoreSlim.Release(); - } - }); - } -} - -#endif diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/Tracing/PlatformEqtTrace.cs b/src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/Tracing/PlatformEqtTrace.cs deleted file mode 100644 index 3c5d4368d0..0000000000 --- a/src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/Tracing/PlatformEqtTrace.cs +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -#if WINDOWS_UWP - -using System; -using System.Diagnostics.Tracing; -using System.IO; - -using Microsoft.TestPlatform.PlatformAbstractions; - -namespace Microsoft.VisualStudio.TestPlatform.ObjectModel; - -/// -/// Wrapper class for tracing. -/// - Shortcut-methods for Error, Warning, Info, Verbose. -/// - Adds additional information to the trace: calling process name, PID, ThreadID, Time. -/// - Uses custom switch EqtTraceLevel from .config file. -/// - By default tracing if OFF. -/// - Our build environment always sets the /d:TRACE so this class is always enabled, -/// the Debug class is enabled only in debug builds (/d:DEBUG). -/// - We ignore exceptions thrown by underlying TraceSwitch (e.g. due to config file error). -/// We log ignored exceptions to system Application log. -/// We pass through exceptions thrown due to incorrect arguments to EqtTrace methods. -/// Usage: EqtTrace.Info("Here's how to trace info"); -/// -public class PlatformEqtTrace : IPlatformEqtTrace -{ - private static readonly object InitLock = new(); - - private static bool s_isInitialized; - - public static string? ErrorOnInitialization { get; set; } - - public static string? LogFile { get; set; } - - public bool DoNotInitialize - { - get; - set; - } - - private static PlatformTraceLevel TraceLevel { get; set; } - - /// - public void WriteLine(PlatformTraceLevel level, string? message) - { - if (TraceInitialized() && TraceLevel > PlatformTraceLevel.Off) - { - switch (level) - { - case PlatformTraceLevel.Off: - break; - - case PlatformTraceLevel.Error: - UnitTestEventSource.Log.Error(message); - break; - - case PlatformTraceLevel.Warning: - UnitTestEventSource.Log.Warn(message); - break; - - case PlatformTraceLevel.Info: - UnitTestEventSource.Log.Info(message); - break; - - case PlatformTraceLevel.Verbose: - UnitTestEventSource.Log.Verbose(message); - break; - } - } - } - - /// - public bool InitializeVerboseTrace(string? customLogFile) - { - return InitializeTrace(customLogFile, PlatformTraceLevel.Verbose); - } - - /// - public bool InitializeTrace(string? customLogFile, PlatformTraceLevel traceLevel) - { - string logFileName; - try - { - logFileName = customLogFile is not null - ? Path.GetFileNameWithoutExtension(customLogFile.TrimStart('"').TrimEnd('"')).Replace(" ", "_") - : Guid.NewGuid().ToString(); - } - catch - { - logFileName = Guid.NewGuid().ToString(); - } - - LogFile = Path.Combine(Path.GetTempPath(), logFileName + ".TpTrace.log"); - TraceLevel = traceLevel; - - return TraceInitialized(); - } - - /// - public bool ShouldTrace(PlatformTraceLevel traceLevel) - { - return s_isInitialized; - } - - /// - public string? GetLogFile() - { - return LogFile; - } - - /// - public void SetTraceLevel(PlatformTraceLevel value) - { - TraceLevel = value; - } - - /// - public PlatformTraceLevel GetTraceLevel() - { - return TraceLevel; - } - - /// - /// Initializes Tracing based on Trace Level - /// - /// - /// The . - /// - private bool TraceInitialized() - { - lock (InitLock) - { - if (s_isInitialized) - { - return s_isInitialized; - } - - try - { - var eventListener = new FileEventListener(LogFile.IsNullOrEmpty() ? "UnitTestLog" : LogFile); - - PlatformTraceLevel traceLevel = GetTraceLevel(); - if (traceLevel > PlatformTraceLevel.Off) - { - eventListener.EnableEvents(UnitTestEventSource.Log, EventLevel.Error); - } - - if (traceLevel > PlatformTraceLevel.Error) - { - eventListener.EnableEvents(UnitTestEventSource.Log, EventLevel.Warning); - } - - if (traceLevel > PlatformTraceLevel.Warning) - { - eventListener.EnableEvents(UnitTestEventSource.Log, EventLevel.Informational); - } - - if (traceLevel > PlatformTraceLevel.Info) - { - eventListener.EnableEvents(UnitTestEventSource.Log, EventLevel.Verbose); - } - - s_isInitialized = true; - } - catch (Exception ex) - { - UnInitializeTrace(); - ErrorOnInitialization = ex.Message; - return false; - } - - return s_isInitialized; - } - } - - private static void UnInitializeTrace() - { - s_isInitialized = false; - LogFile = null; - TraceLevel = PlatformTraceLevel.Off; - } -} - -#endif diff --git a/src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/Tracing/UnitTestEventSource.cs b/src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/Tracing/UnitTestEventSource.cs deleted file mode 100644 index 07cfc77aee..0000000000 --- a/src/Microsoft.TestPlatform.PlatformAbstractions/uap10.0/Tracing/UnitTestEventSource.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -#if WINDOWS_UWP - -using System.Diagnostics.Tracing; - -namespace Microsoft.VisualStudio.TestPlatform.ObjectModel; - -internal sealed class UnitTestEventSource : EventSource -{ - public static UnitTestEventSource Log { get; } = new UnitTestEventSource(); - - [Event(1, Level = EventLevel.Verbose)] - public void Verbose(string? message) - { - WriteEvent(1, message); - } - - [Event(2, Level = EventLevel.Informational)] - public void Info(string? message) - { - WriteEvent(2, message); - } - - [Event(3, Level = EventLevel.Warning)] - public void Warn(string? message) - { - WriteEvent(3, message); - } - - [Event(4, Level = EventLevel.Error)] - public void Error(string? message) - { - WriteEvent(4, message); - } - - [Event(5, Level = EventLevel.Critical)] - public void Critical(string? message) - { - WriteEvent(5, message); - } -} - -#endif diff --git a/src/package/nuspec/Microsoft.NET.Test.Sdk.nuspec b/src/package/nuspec/Microsoft.NET.Test.Sdk.nuspec index 7653b82084..2e88f92307 100644 --- a/src/package/nuspec/Microsoft.NET.Test.Sdk.nuspec +++ b/src/package/nuspec/Microsoft.NET.Test.Sdk.nuspec @@ -19,14 +19,6 @@ branch="$BranchName$" commit="$CommitId$" /> - - - - - - - - @@ -46,10 +38,8 @@ - - diff --git a/src/package/nuspec/Microsoft.TestPlatform.AdapterUtilities.nuspec b/src/package/nuspec/Microsoft.TestPlatform.AdapterUtilities.nuspec index 22f9f0df97..7790242ad2 100644 --- a/src/package/nuspec/Microsoft.TestPlatform.AdapterUtilities.nuspec +++ b/src/package/nuspec/Microsoft.TestPlatform.AdapterUtilities.nuspec @@ -24,10 +24,6 @@ - - - - @@ -39,9 +35,6 @@ - - - diff --git a/src/package/nuspec/TestPlatform.Internal.Uwp.nuspec b/src/package/nuspec/TestPlatform.Internal.Uwp.nuspec index cab44e1fbe..e265c0112d 100644 --- a/src/package/nuspec/TestPlatform.Internal.Uwp.nuspec +++ b/src/package/nuspec/TestPlatform.Internal.Uwp.nuspec @@ -21,7 +21,7 @@ - + @@ -66,59 +66,9 @@ - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/package/nuspec/TestPlatform.ObjectModel.nuspec b/src/package/nuspec/TestPlatform.ObjectModel.nuspec index 8dbc8c2ae6..c2ab6fa44a 100644 --- a/src/package/nuspec/TestPlatform.ObjectModel.nuspec +++ b/src/package/nuspec/TestPlatform.ObjectModel.nuspec @@ -30,17 +30,6 @@ - - - - - - - - - - - @@ -140,38 +129,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/package/nuspec/TestPlatform.TestHost.nuspec b/src/package/nuspec/TestPlatform.TestHost.nuspec index 0fff8c139a..162816dbd8 100644 --- a/src/package/nuspec/TestPlatform.TestHost.nuspec +++ b/src/package/nuspec/TestPlatform.TestHost.nuspec @@ -25,12 +25,6 @@ - - - - - - @@ -70,102 +64,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/package/sign/sign.proj b/src/package/sign/sign.proj index e58d282922..553e090587 100644 --- a/src/package/sign/sign.proj +++ b/src/package/sign/sign.proj @@ -197,11 +197,6 @@ - - - - - @@ -215,7 +210,6 @@ - @@ -232,7 +226,6 @@ - @@ -252,15 +245,6 @@ - - - - - - - - - @@ -290,11 +274,9 @@ - - @@ -304,11 +286,6 @@ StrongName - - Microsoft400 - StrongName - - Microsoft400 StrongName @@ -361,12 +338,6 @@ IntermediatesDirectory="$(IntermediatesDirectory)" Type="$(SignType)" /> - - -