Update preprocessor directives ahead of System.Diagnostics.DiagnosticSource .NET 7 update. (#3095)

This commit is contained in:
Mikel Blanchard 2022-03-28 07:20:22 -07:00 committed by GitHub
parent de4441124e
commit bf79f0d40d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 13 additions and 12 deletions

View File

@ -14,7 +14,7 @@
// limitations under the License.
// </copyright>
#if NET461
#if NETFRAMEWORK
using System.Collections;
using System.Reflection;
using System.Runtime.CompilerServices;

View File

@ -14,7 +14,7 @@
// limitations under the License.
// </copyright>
#if NETSTANDARD2_0 || NET461
#if NETSTANDARD2_0 || NETFRAMEWORK
using System;
#endif
using Thrift.Protocol;

View File

@ -14,7 +14,7 @@
// limitations under the License.
// </copyright>
#if NETSTANDARD2_0 || NET461
#if NETSTANDARD2_0 || NETFRAMEWORK
using System;
#endif
using Thrift.Protocol;

View File

@ -14,7 +14,7 @@
// limitations under the License.
// </copyright>
#if NETSTANDARD2_0 || NET461
#if NETSTANDARD2_0 || NETFRAMEWORK
namespace System
{
internal static class ShimExtensions

View File

@ -14,7 +14,7 @@
// limitations under the License.
// </copyright>
#if NET461 || NETSTANDARD2_0 || NETSTANDARD2_1 || NETCOREAPP3_1_OR_GREATER
#if NETFRAMEWORK || NETSTANDARD2_0_OR_GREATER || NETCOREAPP3_1_OR_GREATER
using Microsoft.Extensions.Options;
#endif
@ -34,7 +34,7 @@ namespace System
public static T GetOptions<T>(this IServiceProvider serviceProvider)
where T : class, new()
{
#if NET461 || NETSTANDARD2_0 || NETSTANDARD2_1 || NETCOREAPP3_1_OR_GREATER
#if NETFRAMEWORK || NETSTANDARD2_0_OR_GREATER || NETCOREAPP3_1_OR_GREATER
IOptions<T> options = (IOptions<T>)serviceProvider.GetService(typeof(IOptions<T>));
// Note: options could be null if user never invoked services.AddOptions().

View File

@ -16,7 +16,7 @@
using System;
using System.Diagnostics.Metrics;
#if NET461
#if NETFRAMEWORK
using System.Linq;
#endif
using System.Threading;

View File

@ -48,7 +48,7 @@ namespace OpenTelemetry.Exporter.Prometheus.Tests
.AddMeter(meter.Name)
.AddPrometheusExporter(o =>
{
#if NET461
#if NETFRAMEWORK
bool expectedDefaultState = true;
#else
bool expectedDefaultState = false;
@ -142,7 +142,7 @@ namespace OpenTelemetry.Exporter.Prometheus.Tests
if (ex is not ArgumentNullException)
{
Assert.Equal("System.ArgumentException", ex.GetType().ToString());
#if NET461
#if NETFRAMEWORK
Assert.Equal("Prometheus server path should be a valid URI with http/https scheme.\r\nParameter name: httpListenerPrefixes", ex.Message);
#else
Assert.Equal("Prometheus server path should be a valid URI with http/https scheme. (Parameter 'httpListenerPrefixes')", ex.Message);

View File

@ -14,7 +14,7 @@
// limitations under the License.
// </copyright>
#if !NET461
#if !NETFRAMEWORK
using System;
using System.Collections.Generic;
using System.Diagnostics.Metrics;

View File

@ -160,7 +160,7 @@ namespace OpenTelemetry.Instrumentation.StackExchangeRedis.Implementation
Assert.Equal(dnsEndPoint.Port, result.GetTagValue(SemanticConventions.AttributeNetPeerPort));
}
#if !NET461
#if !NETFRAMEWORK
[Fact]
public void ProfilerCommandToActivity_UsesOtherEndPointAsEndPoint()
{

View File

@ -13,7 +13,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
#if !NET461
#if !NETFRAMEWORK
using System;
using System.Collections;
using System.Collections.Generic;