Update preprocessor directives ahead of System.Diagnostics.DiagnosticSource .NET 7 update. (#3095)
This commit is contained in:
parent
de4441124e
commit
bf79f0d40d
|
|
@ -14,7 +14,7 @@
|
|||
// limitations under the License.
|
||||
// </copyright>
|
||||
|
||||
#if NET461
|
||||
#if NETFRAMEWORK
|
||||
using System.Collections;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
// limitations under the License.
|
||||
// </copyright>
|
||||
|
||||
#if NETSTANDARD2_0 || NET461
|
||||
#if NETSTANDARD2_0 || NETFRAMEWORK
|
||||
using System;
|
||||
#endif
|
||||
using Thrift.Protocol;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
// limitations under the License.
|
||||
// </copyright>
|
||||
|
||||
#if NETSTANDARD2_0 || NET461
|
||||
#if NETSTANDARD2_0 || NETFRAMEWORK
|
||||
using System;
|
||||
#endif
|
||||
using Thrift.Protocol;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
// limitations under the License.
|
||||
// </copyright>
|
||||
|
||||
#if NETSTANDARD2_0 || NET461
|
||||
#if NETSTANDARD2_0 || NETFRAMEWORK
|
||||
namespace System
|
||||
{
|
||||
internal static class ShimExtensions
|
||||
|
|
|
|||
|
|
@ -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().
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
using System;
|
||||
using System.Diagnostics.Metrics;
|
||||
#if NET461
|
||||
#if NETFRAMEWORK
|
||||
using System.Linq;
|
||||
#endif
|
||||
using System.Threading;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
// limitations under the License.
|
||||
// </copyright>
|
||||
|
||||
#if !NET461
|
||||
#if !NETFRAMEWORK
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.Metrics;
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue