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

Updated supported target frameworks #223

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from
Draft
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
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ jobs:
strategy:
fail-fast: false
matrix:
version: [net452, netcoreapp2.0, netcoreapp3.1]
version: [net462, net472, net48, netcoreapp3.1, net6.0]

steps:
- name: Checkout repository
uses: actions/checkout@v2

- uses: actions/setup-dotnet@v1
with:
dotnet-version: '2.0.x'
dotnet-version: '3.1.x'

- uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x'
dotnet-version: '6.0.x'

- name: Install dependencies
run: dotnet restore sdk/AWSXRayRecorder.sln
Expand Down
34 changes: 17 additions & 17 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;net472;net48;netstandard2.0;netcoreapp3.1;net6.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 All @@ -21,12 +21,8 @@
<RepositoryUrl>https://github.com/aws/aws-xray-sdk-dotnet</RepositoryUrl>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<NoWarn>1701;1702;1705;1591;1587;1572;1573;3001</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<NoWarn>1701;1702;1705;1591;1587;1572;1573;3001</NoWarn>
<PropertyGroup>
<NoWarn>1591;1587;1572;1573</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand All @@ -38,27 +34,31 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="AWSSDK.Core" Version="3.3.25.1" />
<PackageReference Include="AWSSDK.Core" Version="3.7.5.8" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="2.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<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)' == 'net6.0'">
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0"/>
</ItemGroup>

<ItemGroup Condition="!('$(TargetFramework)' == 'net462' or '$(TargetFramework)' == 'net472' or '$(TargetFramework)' == 'net48')">
<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' or '$(TargetFramework)' == 'net472' or '$(TargetFramework)' == 'net48'">
<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' or '$(TargetFramework)' == 'net472' or '$(TargetFramework)' == 'net48'">
<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
2 changes: 1 addition & 1 deletion sdk/src/Core/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Runtime.CompilerServices;

[assembly: ComVisible(false)]
[assembly: CLSCompliant(true)]
[assembly: CLSCompliant(false)]
[assembly: InternalsVisibleTo("AWSXRayRecorder.UnitTests,PublicKey="+
"0024000004800000940000000602000000240000525341310004000001000100712913451f6deb"
+ "158da1d2129b21119cca7d4eebeef5b310e8acd7f2d9506346071207652f1210a3bfa1545d6897"
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
15 changes: 4 additions & 11 deletions sdk/src/Handlers/AspNet/AWSXRayRecorder.Handlers.AspNet.csproj
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;net472;net48</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 All @@ -21,23 +21,16 @@
<RepositoryUrl>https://github.com/aws/aws-xray-sdk-dotnet</RepositoryUrl>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<NoWarn>1701;1702;1705;1591;1587;1572;1573</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<NoWarn>1701;1702;1705;1591;1587;1572;1573</NoWarn>
<PropertyGroup>
<NoWarn>1591;1587;1572;1573</NoWarn>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\Core\AWSXRayRecorder.Core.csproj" />
</ItemGroup>

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

<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Web" />
<Reference Include="System.Net.Http" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/Handlers/AspNet/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System;
using System.Runtime.InteropServices;

[assembly: CLSCompliant(true)]
[assembly: CLSCompliant(false)]
[assembly: ComVisible(false)]
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netcoreapp3.1;net6.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 All @@ -20,23 +20,22 @@
<RepositoryUrl>https://github.com/aws/aws-xray-sdk-dotnet</RepositoryUrl>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<NoWarn>1701;1702;1705;1591;1573;1587</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<NoWarn>1701;1702;1705;1591;1587;1573;1572</NoWarn>
<PropertyGroup>
<NoWarn>1591;1587;1573;1572</NoWarn>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.AspNetCore.Http.Extensions" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Abstractions" Version="2.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.AspNetCore.Mvc.Abstractions" Version="2.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Core\AWSXRayRecorder.Core.csproj" />
</ItemGroup>
Expand Down
12 changes: 4 additions & 8 deletions sdk/src/Handlers/AwsSdk/AWSXRayRecorder.Handlers.AwsSdk.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>net462;net472;net48;netstandard2.0;netcoreapp3.1;net6.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 All @@ -21,12 +21,8 @@
<RepositoryUrl>https://github.com/aws/aws-xray-sdk-dotnet</RepositoryUrl>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<NoWarn>1701;1702;1705;1591</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<NoWarn>1701;1702;1705;1591;1587;1572;1573</NoWarn>
<PropertyGroup>
<NoWarn>1591;1587;1572;1573</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand All @@ -37,7 +33,7 @@
<EmbeddedResource Include="DefaultAWSWhitelist.json" />
</ItemGroup>

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

Expand Down
2 changes: 1 addition & 1 deletion sdk/src/Handlers/AwsSdk/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System;
using System.Runtime.InteropServices;

[assembly: CLSCompliant(true)]
[assembly: CLSCompliant(false)]
[assembly: ComVisible(false)]
Loading