Skip to content

Commit

Permalink
update .net framework version to 452
Browse files Browse the repository at this point in the history
  • Loading branch information
enif-lee committed Sep 11, 2020
1 parent 3ae4cdb commit 0108448
Show file tree
Hide file tree
Showing 34 changed files with 108 additions and 104 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,7 @@ $RECYCLE.BIN/
# Mac desktop service store files
.DS_Store
awsxrayrecorder-release.snk


# Ignore Jetbrains Rider Configuration
.idea
12 changes: 6 additions & 6 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</TargetFrameworks>
<TargetFrameworks>net452;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 @@ -48,10 +48,10 @@
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.0.0" />
</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)' != 'net452'">
<Compile Remove="Internal\Context\CallContextContainer.net452.cs" />
<Compile Remove="Internal\Context\HybridContextContainer.net452.cs" />
<Compile Remove="Internal\Utils\AppSettings.net452.cs" />
<Compile Remove="AWSXRayRecorder.cs" />
</ItemGroup>

Expand All @@ -64,7 +64,7 @@
<Compile Remove="FacadeSegment.cs" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net45'">
<ItemGroup Condition=" '$(TargetFramework)' == 'net452'">
<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 @@ -36,7 +36,7 @@ namespace Amazon.XRay.Recorder.Core
public abstract class AWSXRayRecorderImpl : IAWSXRayRecorder
{
private static readonly Logger _logger = Logger.GetLogger(typeof(AWSXRayRecorderImpl));
#if NET45
#if NET452
private static Lazy<AWSXRayRecorder> _lazyDefaultRecorder = new Lazy<AWSXRayRecorder>(() => AWSXRayRecorderBuilder.GetDefaultBuilder().Build());
protected static Lazy<AWSXRayRecorder> LazyDefaultRecorder
{
Expand Down Expand Up @@ -150,7 +150,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 !NET452
if (AWSXRayRecorder.IsLambda())
{
throw new UnsupportedOperationException("Cannot override Facade Segment. New segment not created.");
Expand Down Expand Up @@ -192,7 +192,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 !NET452
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 Dictionary<string, string>();

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

#if NET45
#if NET452
/// <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
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 NET452
return new CallContextContainer();
#else
if (AWSXRayRecorder.IsLambda())
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 NET452
_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 NET452
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 NET452
/// <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 NET452
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 NET452
/// <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 NET452
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 NET452
/// <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>net452</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 @@
<ProjectReference Include="..\..\Core\AWSXRayRecorder.Core.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net45'">
<ItemGroup Condition="'$(TargetFramework)' == 'net452'">
<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>net452;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)' != 'net452'">
<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>net452;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,8 +37,8 @@
<ProjectReference Include="..\..\Core\AWSXRayRecorder.Core.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'net45'">
<Compile Remove="TraceableSqlCommand.net45.cs" />
<ItemGroup Condition="'$(TargetFramework)' != 'net452'">
<Compile Remove="TraceableSqlCommand.net452.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 !NET452
private bool ShouldCollectSqlText()
=> _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">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net45;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net452;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</TargetFrameworks>
<TargetFrameworks>net452;netcoreapp2.0</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 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 NET452
protected BatchGetTracesResponse BatchGetTraces(string traceId)
{
var request = new BatchGetTracesRequest();
Expand Down
10 changes: 5 additions & 5 deletions sdk/test/IntegrationTests/ValidateSegmentTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void TestMinimalSegment()
var segment = AWSXRayRecorder.Instance.TraceContext.GetEntity();
Thread.Sleep(100);
Recorder.EndSegment();
#if NET45
#if NET452
var response = BatchGetTraces(traceId);
#else
var response = BatchGetTracesAsync(traceId).Result;
Expand Down Expand Up @@ -80,7 +80,7 @@ public void TestMultipleSubsegments()
AWSXRayRecorder.Instance.TraceContext.GetEntity().Subsegments.ForEach(x => subsegmentNames[x.Id] = x.Name);

Recorder.EndSegment();
#if NET45
#if NET452
var response = BatchGetTraces(traceId);
#else
var response = BatchGetTracesAsync(traceId).Result;
Expand Down Expand Up @@ -120,7 +120,7 @@ public void TestEC2Plugin()
Thread.Sleep(100);
recorder.EndSegment();

#if NET45
#if NET452
var response = BatchGetTraces(traceId);
#else
var response = BatchGetTracesAsync(traceId).Result;
Expand Down Expand Up @@ -151,7 +151,7 @@ public void TestECSPlugin()
recorder.BeginSegment(GetType().Name, traceId);
Thread.Sleep(100);
recorder.EndSegment();
#if NET45
#if NET452
var response = BatchGetTraces(traceId);
#else
var response = BatchGetTracesAsync(traceId).Result;
Expand Down Expand Up @@ -182,7 +182,7 @@ public void TestElasticBeanstalkPlugin()
recorder.BeginSegment(GetType().Name, traceId);
Thread.Sleep(100);
recorder.EndSegment();
#if NET45
#if NET452
var response = BatchGetTraces(traceId);
#else
var response = BatchGetTracesAsync(traceId).Result;
Expand Down
Loading

0 comments on commit 0108448

Please sign in to comment.