Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update net45 to net462 #233

Open
wants to merge 1 commit into
base: 3.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
version: [net452, netcoreapp2.0, netcoreapp3.1]
version: [net462, netcoreapp2.0, netcoreapp3.1]

steps:
- name: Checkout repository
Expand Down
2 changes: 1 addition & 1 deletion sdk/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</ItemGroup>

<!-- NetFramework does not support embedded pdb -->
<PropertyGroup Condition="'$(TargetFramework)' == 'net45' or '$(TargetFramework)' == 'net452'">
<PropertyGroup Condition="'$(TargetFramework)' == 'net462'">
<DebugType>portable</DebugType>
</PropertyGroup>
</Project>
14 changes: 7 additions & 7 deletions sdk/src/Core/AWSXRayRecorder.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net45;netstandard2.0;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net462;netstandard2.0;netcoreapp3.1</TargetFrameworks>
<Company>Amazon.com, Inc</Company>
<Product>Amazon Web Service X-Ray Recorder</Product>
<Copyright>Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.</Copyright>
Expand Down Expand Up @@ -51,14 +51,14 @@
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'net45'">
<Compile Remove="Internal\Context\CallContextContainer.net45.cs" />
<Compile Remove="Internal\Context\HybridContextContainer.net45.cs" />
<Compile Remove="Internal\Utils\AppSettings.net45.cs" />
<ItemGroup Condition="'$(TargetFramework)' != 'net462'">
<Compile Remove="Internal\Context\CallContextContainer.netframework.cs" />
<Compile Remove="Internal\Context\HybridContextContainer.netframework.cs" />
<Compile Remove="Internal\Utils\AppSettings.netframework.cs" />
<Compile Remove="AWSXRayRecorder.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net45'">
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<Compile Remove="Internal\Context\AsyncLocalContextContainer.netstandard.cs" />
<Compile Remove="Internal\Context\LambdaContextContainer.netstandard.cs" />
<Compile Remove="Internal\Utils\AppSettings.netcore.cs" />
Expand All @@ -67,7 +67,7 @@
<Compile Remove="FacadeSegment.cs" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net45'">
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<Reference Include="System.Configuration" />
<Reference Include="System.Web" />
<Reference Include="System.Net.Http" />
Expand Down
10 changes: 5 additions & 5 deletions sdk/src/Core/AWSXRayRecorderImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace Amazon.XRay.Recorder.Core
public abstract class AWSXRayRecorderImpl : IAWSXRayRecorder
{
private static readonly Logger _logger = Logger.GetLogger(typeof(AWSXRayRecorderImpl));
#if NET45
#if NETFRAMEWORK
private static Lazy<AWSXRayRecorder> _lazyDefaultRecorder = new Lazy<AWSXRayRecorder>(() => AWSXRayRecorderBuilder.GetDefaultBuilder().Build());
protected static Lazy<AWSXRayRecorder> LazyDefaultRecorder
{
Expand Down Expand Up @@ -151,7 +151,7 @@ public ContextMissingStrategy ContextMissingStrategy
/// <exception cref="ArgumentNullException">The argument has a null value.</exception>
public void BeginSegment(string name, string traceId = null, string parentId = null, SamplingResponse samplingResponse = null, DateTime? timestamp = null)
{
#if !NET45
#if !NETFRAMEWORK
if (AWSXRayRecorder.IsLambda())
{
throw new UnsupportedOperationException("Cannot override Facade Segment. New segment not created.");
Expand Down Expand Up @@ -193,7 +193,7 @@ public void BeginSegment(string name, string traceId = null, string parentId = n
/// <exception cref="EntityNotAvailableException">Entity is not available in trace context.</exception>
public void EndSegment(DateTime? timestamp = null)
{
#if !NET45
#if !NETFRAMEWORK
if (AWSXRayRecorder.IsLambda())
{
throw new UnsupportedOperationException("Cannot override Facade Segment. New segment not created.");
Expand Down Expand Up @@ -727,7 +727,7 @@ protected void PopulateContexts()
// Prepare XRay section for runtime context
var xrayContext = new ConcurrentDictionary<string, string>();

#if NET45
#if NETFRAMEWORK
xrayContext["sdk"] = "X-Ray for .NET";
#else
xrayContext["sdk"] = "X-Ray for .NET Core";
Expand All @@ -743,7 +743,7 @@ protected void PopulateContexts()
}

RuntimeContext["xray"] = xrayContext;
#if NET45
#if NETFRAMEWORK
ServiceContext["runtime"] = ".NET Framework";
#else
ServiceContext["runtime"] = ".NET Core Framework";
Expand Down
4 changes: 2 additions & 2 deletions sdk/src/Core/AwsXrayRecorderBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public IReadOnlyList<IPlugin> Plugins
}
}

#if NET45
#if NETFRAMEWORK
/// <summary>
/// Initializes <see cref="AWSXRayRecorderBuilder"/> instance with default settings.
/// </summary>
Expand All @@ -67,7 +67,7 @@ public static AWSXRayRecorderBuilder GetDefaultBuilder()
}
#endif

#if NET45
#if NETFRAMEWORK
/// <summary>
/// Reads plugin settings from app settings, and adds new instance of each plugin into the builder.
/// If the plugin settings doesn't exist or the value of the settings is invalid, nothing will be added.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//-----------------------------------------------------------------------------
// <copyright file="CallContextContainer.net45.cs" company="Amazon.com">
// <copyright file="CallContextContainer.netframework.cs" company="Amazon.com">
// Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License").
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/Core/Internal/Context/DefaultTraceContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static class DefaultTraceContext
/// <returns>default instance of <see cref="ITraceContext"/></returns>
public static ITraceContext GetTraceContext()
{
#if NET45
#if NETFRAMEWORK
return new CallContextContainer();
#else
if (AWSXRayRecorder.IsLambda())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//-----------------------------------------------------------------------------
// <copyright file="TraceContext.net45.cs" company="Amazon.com">
// <copyright file="TraceContext.netframework.cs" company="Amazon.com">
// Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License").
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/Core/Internal/Emitters/UdpSegmentEmitter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ protected virtual void Dispose(bool disposing)
{
if (_udpClient != null)
{
#if NET45
#if NETFRAMEWORK
_udpClient.Close();
#else
_udpClient.Dispose();
Expand Down
4 changes: 2 additions & 2 deletions sdk/src/Core/Strategies/DynamicSegmentNamingStrategy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
using System.Text.RegularExpressions;
using Amazon.Runtime.Internal.Util;
using Amazon.XRay.Recorder.Core.Internal.Utils;
#if NET45
#if NETFRAMEWORK
using System.Net.Http;
#else
using Microsoft.AspNetCore.Http;
Expand Down Expand Up @@ -80,7 +80,7 @@ public DynamicSegmentNamingStrategy(string fallbackSegmentName, string hostNameP
/// </summary>
public string FallbackSegmentName { get; set; }

#if NET45
#if NETFRAMEWORK
/// <summary>
/// Gets the name of the segment.
/// </summary>
Expand Down
4 changes: 2 additions & 2 deletions sdk/src/Core/Strategies/FixedSegmentNamingStrategy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
using System;

using Amazon.Runtime.Internal.Util;
#if NET45
#if NETFRAMEWORK
using System.Net.Http;
#else
using Microsoft.AspNetCore.Http;
Expand Down Expand Up @@ -60,7 +60,7 @@ public FixedSegmentNamingStrategy(string fixedName)
/// </summary>
public string FixedName { get; set; }

#if NET45
#if NETFRAMEWORK
/// <summary>
/// Gets the name of the segment.
/// </summary>
Expand Down
4 changes: 2 additions & 2 deletions sdk/src/Core/Strategies/SegmentNamingStrategy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

using System;

#if NET45
#if NETFRAMEWORK
using System.Net.Http;
#else
using Microsoft.AspNetCore.Http;
Expand All @@ -45,7 +45,7 @@ public static string GetSegmentNameFromEnvironmentVariable()
return Environment.GetEnvironmentVariable(SegmentNamingStrategy.EnvironmentVariableSegmentName);
}

#if NET45
#if NETFRAMEWORK
/// <summary>
/// Gets the name of the segment.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net45</TargetFrameworks>
<TargetFrameworks>net462</TargetFrameworks>
<Company>Amazon.com, Inc</Company>
<Product>Amazon Web Service X-Ray Recorder</Product>
<Copyright>Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.</Copyright>
Expand Down Expand Up @@ -33,7 +33,7 @@
<ProjectReference Include="..\..\Core\AWSXRayRecorder.Core.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net45'">
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<Reference Include="Microsoft.CSharp" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net45;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net462;netstandard2.0</TargetFrameworks>
<Company>Amazon.com, Inc</Company>
<Product>Amazon Web Service X-Ray Recorder</Product>
<Copyright>Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.</Copyright>
Expand Down Expand Up @@ -37,7 +37,7 @@
<EmbeddedResource Include="DefaultAWSWhitelist.json" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'net45'">
<ItemGroup Condition="'$(TargetFramework)' != 'net462'">
<Compile Remove="AWSSdkTracingHandler.cs" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net45;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net462;netstandard2.0</TargetFrameworks>
<Company>Amazon.com, Inc</Company>
<Product>Amazon Web Service X-Ray Recorder</Product>
<Copyright>Copyright 2017-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.</Copyright>
Expand Down Expand Up @@ -33,10 +33,10 @@
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="3.1.0" />
<Compile Remove="AWSXRayEntityFramework6.cs" />
<Compile Remove="EFInterceptor.net45.cs" />
<Compile Remove="EFInterceptor.netframework.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net45'">
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<PackageReference Include="EntityFramework" Version="6.2.0" />
<Compile Remove="AWSXRayInterceptorExtensions.cs" />
<Compile Remove="EFInterceptor.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//-----------------------------------------------------------------------------
// <copyright file="EFInterceptor.net45.cs" company="Amazon.com">
// <copyright file="EFInterceptor.netframework.cs" company="Amazon.com">
// Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License").
Expand Down
4 changes: 2 additions & 2 deletions sdk/src/Handlers/EntityFramework/EFUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
using System.Text.RegularExpressions;
using Amazon.Runtime.Internal.Util;
using Amazon.XRay.Recorder.Core;
#if NET45
#if NETFRAMEWORK
using Amazon.XRay.Recorder.Core.Internal.Utils;
#endif

Expand Down Expand Up @@ -191,7 +191,7 @@ private static string RemovePortNumberFromDataSource(string dataSource)
return _portNumberRegex.Replace(dataSource, string.Empty);
}

#if !NET45
#if !NETFRAMEWORK
private static bool ShouldCollectSqlText(bool? collectSqlQueriesOverride)
=> collectSqlQueriesOverride ?? _recorder.XRayOptions.CollectSqlQueries;
#else
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net45;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net462;netstandard2.0</TargetFrameworks>
<Company>Amazon.com, Inc</Company>
<Product>Amazon Web Service X-Ray Recorder</Product>
<Copyright>Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.</Copyright>
Expand Down Expand Up @@ -33,8 +33,8 @@
<ProjectReference Include="..\..\Core\AWSXRayRecorder.Core.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'net45'">
<Compile Remove="TraceableSqlCommand.net45.cs" />
<ItemGroup Condition="'$(TargetFramework)' != 'net462'">
<Compile Remove="TraceableSqlCommand.netframework.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' != 'netstandard2.0'">
<Compile Remove="TraceableSqlCommand.netstandard.cs" />
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/Handlers/SqlServer/DbCommandInterceptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ protected virtual void CollectSqlInformation(DbCommand command)
private string BuildSubsegmentName(DbCommand command)
=> command.Connection.Database + "@" + SqlUtil.RemovePortNumberFromDataSource(command.Connection.DataSource);

#if !NET45
#if !NETFRAMEWORK
private bool ShouldCollectSqlText()
=> _collectSqlQueriesOverride ?? _recorder.XRayOptions.CollectSqlQueries;
#else
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//-----------------------------------------------------------------------------
// <copyright file="TraceableSqlCommand.net45.cs" company="Amazon.com">
// <copyright file="TraceableSqlCommand.netframework.cs" company="Amazon.com">
// Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License").
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net45;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net462;netstandard2.0</TargetFrameworks>
<Company>Amazon.com, Inc</Company>
<Product>Amazon Web Service X-Ray Recorder</Product>
<Copyright>Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.</Copyright>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


<PropertyGroup>
<TargetFrameworks>net45;netcoreapp2.0;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net462;netcoreapp2.0;netcoreapp3.1</TargetFrameworks>
<Company>Amazon.com, Inc</Company>
<Product>Amazon Web Service X-Ray Recorder</Product>
<Copyright>Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.</Copyright>
Expand All @@ -21,9 +21,9 @@
<PackageReference Include="Moq" Version="4.7.137" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.1.18" />
<PackageReference Include="MSTest.TestFramework" Version="1.1.18" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.8" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.8" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Core\AWSXRayRecorder.Core.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion sdk/test/IntegrationTests/TestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected static void ClassCleanup()
Recorder.Dispose();
}

#if NET45
#if NETFRAMEWORK
protected BatchGetTracesResponse BatchGetTraces(string traceId)
{
var request = new BatchGetTracesRequest();
Expand Down
Loading