Skip to content
Merged
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
13 changes: 13 additions & 0 deletions sdk/AWSXRayRecorder.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,19 @@
<dependency id="AWSXRayRecorder.Handlers.SqlServer" version="2.7.3" />
<dependency id="AWSXRayRecorder.Handlers.System.Net" version="2.7.3" />
</group>
<group targetFramework=".NETCoreApp3.1">
<dependency id="AWSXRayRecorder.Core" version="2.10.1" />
<dependency id="AWSXRayRecorder.Handlers.AspNetCore" version="2.7.3" />
<dependency id="AWSXRayRecorder.Handlers.AwsSdk" version="2.8.3" />
<dependency id="AWSXRayRecorder.Handlers.EntityFramework" version="1.1.1" />
<dependency id="AWSXRayRecorder.Handlers.SqlServer" version="2.7.3" />
<dependency id="AWSXRayRecorder.Handlers.System.Net" version="2.7.3" />
</group>
</dependencies>
<frameworkReferences>
<group targetFramework=".NETCoreApp3.1">
<frameworkReference name="Microsoft.AspNetCore.App" />
</group>
</frameworkReferences>
</metadata>
</package>
10 changes: 7 additions & 3 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>net45;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 @@ -46,15 +46,19 @@
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" 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" />
<Compile Remove="AWSXRayRecorder.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'netstandard2.0'">
<ItemGroup Condition="'$(TargetFramework)' == 'net45'">
<Compile Remove="Internal\Context\AsyncLocalContextContainer.netstandard.cs" />
<Compile Remove="Internal\Context\LambdaContextContainer.netstandard.cs" />
<Compile Remove="Internal\Utils\AppSettings.netcore.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<TargetFrameworks>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 @@ -28,11 +28,15 @@
<NoWarn>1701;1702;1705;1591;1587;1573;1572</NoWarn>
</PropertyGroup>

<ItemGroup>
<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>
<ProjectReference Include="..\..\Core\AWSXRayRecorder.Core.csproj" />
</ItemGroup>
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>net45;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 Down
2 changes: 1 addition & 1 deletion sdk/test/SmokeTests/AWSXRayRecorder.SmokeTests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net452;netcoreapp2.0</TargetFrameworks>
<TargetFrameworks>net452;netcoreapp2.0;netcoreapp3.1</TargetFrameworks>
<Company>Amazon.com, Inc</Company>
<Product>Amazon Web Service X-Ray Recorder</Product>
<Copyright>Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.</Copyright>
Expand Down
18 changes: 16 additions & 2 deletions sdk/test/UnitTests/AWSXRayRecorder.UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


<PropertyGroup>
<TargetFrameworks>net452;netcoreapp2.0</TargetFrameworks>
<TargetFrameworks>net452;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 Down Expand Up @@ -35,6 +35,15 @@
<NoWarn>0618;1701;1702;1705</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netcoreapp3.1|AnyCPU'">
<DefineConstants>TRACE;DEBUG</DefineConstants>
<NoWarn>0618;1701;1702;1705</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netcoreapp3.1|AnyCPU'">
<NoWarn>0618;1701;1702;1705</NoWarn>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AWSSDK.Core" Version="3.5.1.23" />
<PackageReference Include="AWSSDK.DynamoDBv2" Version="3.5.1.1" />
Expand All @@ -55,6 +64,11 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="2.0.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="3.1.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="3.1.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.1.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Data.SQLite" Version="1.0.113.7" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
Expand All @@ -77,7 +91,7 @@
<Compile Remove="Tools\MockHttpRequestFactory.cs" />
<Compile Remove="EF6Tests.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' != 'netcoreapp2.0'">
<ItemGroup Condition="'$(TargetFramework)' == 'net452'">
<PackageReference Include="EntityFramework" Version="6.4.4" />
<PackageReference Include="System.Data.SQLite.EF6" Version="1.0.113" />
<Compile Remove="Tools\MockHttpRequestNetcore.cs" />
Expand Down
7 changes: 6 additions & 1 deletion sdk/test/UnitTests/JsonSegmentMarshallerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public void TestMarshallDelegate()

public object SyncFunction(object obj) => obj;
public void SyncAction(object obj) { return; }
public async Task<object> AsyncFunction(object obj) => obj;
public Task<object> AsyncFunction(object obj) => Task.FromResult(obj);

[TestMethod]
public void TestMarshallSimpleSegment()
Expand Down Expand Up @@ -190,7 +190,12 @@ public void TestMarshallAddException()
var filePath = trace.GetFrame(0).GetFileName().Replace("\\", "\\\\");
var line = new StackTrace(e, true).GetFrame(0).GetFileLineNumber();
var workingDirectory = Directory.GetCurrentDirectory().Replace("\\", "\\\\");

#if NETCOREAPP3_1_OR_GREATER
var expected = "{\"format\":\"json\",\"version\":1}\n{\"id\":\"1111111111111111\",\"start_time\":0,\"end_time\":0,\"name\":\"test\",\"fault\":true,\"cause\":{\"working_directory\":\"" + workingDirectory + "\",\"exceptions\":[{\"id\":\"" + subsegment.Cause.ExceptionDescriptors[0].Id + "\",\"message\":\"Value cannot be null. (Parameter 'value')\",\"type\":\"ArgumentNullException\",\"remote\":false,\"stack\":[{\"path\":\"" + filePath + "\",\"line\":" + line + ",\"label\":\"Amazon.XRay.Recorder.UnitTests.JsonSegmentMarshallerTest.TestMarshallAddException\"}]}]}}";
#else
var expected = "{\"format\":\"json\",\"version\":1}\n{\"id\":\"1111111111111111\",\"start_time\":0,\"end_time\":0,\"name\":\"test\",\"fault\":true,\"cause\":{\"working_directory\":\"" + workingDirectory + "\",\"exceptions\":[{\"id\":\"" + subsegment.Cause.ExceptionDescriptors[0].Id + "\",\"message\":\"Value cannot be null." + Environment.NewLine.Replace("\r", @"\r").Replace("\n", @"\n") + "Parameter name: value\",\"type\":\"ArgumentNullException\",\"remote\":false,\"stack\":[{\"path\":\"" + filePath + "\",\"line\":" + line + ",\"label\":\"Amazon.XRay.Recorder.UnitTests.JsonSegmentMarshallerTest.TestMarshallAddException\"}]}]}}";
#endif

Assert.AreEqual(expected, actual);
}
Expand Down