Skip to content

Commit 70a3cb2

Browse files
authored
Merge pull request #2 from CorrelatorSharp/feature-net-standard
Netstandard
2 parents 62f1a28 + b1bcd89 commit 70a3cb2

File tree

8 files changed

+69
-155
lines changed

8 files changed

+69
-155
lines changed

CorrelatorSharp.RestSharp.sln

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,30 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 14
4-
VisualStudioVersion = 14.0.24720.0
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.27130.2027
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CorrelatorSharp.RestSharp", "CorrelatorSharp.RestSharp\CorrelatorSharp.RestSharp.csproj", "{49000770-7C59-4B43-8B09-DDE00E094780}"
7-
EndProject
86
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{7817AA66-B03D-419B-9F75-F03587BBB08D}"
97
ProjectSection(SolutionItems) = preProject
108
appveyor.yml = appveyor.yml
119
EndProjectSection
1210
EndProject
11+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CorrelatorSharp.RestSharp", "CorrelatorSharp.RestSharp\CorrelatorSharp.RestSharp.csproj", "{A9F3F9CE-F004-4677-BF09-932601635E73}"
12+
EndProject
1313
Global
1414
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1515
Debug|Any CPU = Debug|Any CPU
1616
Release|Any CPU = Release|Any CPU
1717
EndGlobalSection
1818
GlobalSection(ProjectConfigurationPlatforms) = postSolution
19-
{49000770-7C59-4B43-8B09-DDE00E094780}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
20-
{49000770-7C59-4B43-8B09-DDE00E094780}.Debug|Any CPU.Build.0 = Debug|Any CPU
21-
{49000770-7C59-4B43-8B09-DDE00E094780}.Release|Any CPU.ActiveCfg = Release|Any CPU
22-
{49000770-7C59-4B43-8B09-DDE00E094780}.Release|Any CPU.Build.0 = Release|Any CPU
19+
{A9F3F9CE-F004-4677-BF09-932601635E73}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
20+
{A9F3F9CE-F004-4677-BF09-932601635E73}.Debug|Any CPU.Build.0 = Debug|Any CPU
21+
{A9F3F9CE-F004-4677-BF09-932601635E73}.Release|Any CPU.ActiveCfg = Release|Any CPU
22+
{A9F3F9CE-F004-4677-BF09-932601635E73}.Release|Any CPU.Build.0 = Release|Any CPU
2323
EndGlobalSection
2424
GlobalSection(SolutionProperties) = preSolution
2525
HideSolutionNode = FALSE
2626
EndGlobalSection
27+
GlobalSection(ExtensibilityGlobals) = postSolution
28+
SolutionGuid = {49B5AA06-A5E0-4E5A-A103-0D8E732B2B4E}
29+
EndGlobalSection
2730
EndGlobal
Lines changed: 20 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,25 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
43
<PropertyGroup>
5-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7-
<ProjectGuid>{49000770-7C59-4B43-8B09-DDE00E094780}</ProjectGuid>
8-
<OutputType>Library</OutputType>
9-
<AppDesignerFolder>Properties</AppDesignerFolder>
10-
<RootNamespace>CorrelatorSharp.RestSharp</RootNamespace>
4+
<PackageId>CorrelatorSharp.RestSharp</PackageId>
5+
6+
<Version>1.2.0</Version>
7+
8+
<!--Bump the assembly version only on major releases-->
9+
<AssemblyVersion>1.1.0.0</AssemblyVersion>
10+
1111
<AssemblyName>CorrelatorSharp.RestSharp</AssemblyName>
12-
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
13-
<FileAlignment>512</FileAlignment>
14-
<TargetFrameworkProfile />
12+
<Description>CorrelatorSharp, a set of tools for adding correlation identifiers for actions performed by users and machine across your applications. Your one stop shop for context-aware logging and diagnostics.</Description>
13+
<Authors>Ivan Zlatev, Jason Dryhurst-Smith</Authors>
14+
<TargetFrameworks>net46;netstandard2.0</TargetFrameworks>
15+
<PackageTags>context;correlation;logging;diagnostics</PackageTags>
16+
<PackageProjectUrl>https://github.com/CorrelatorSharp/CorrelatorSharp</PackageProjectUrl>
17+
<PackageLicenseUrl>https://github.com/CorrelatorSharp/CorrelatorSharp/blob/master/LICENSE.txt</PackageLicenseUrl>
1518
</PropertyGroup>
16-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17-
<DebugSymbols>true</DebugSymbols>
18-
<DebugType>full</DebugType>
19-
<Optimize>false</Optimize>
20-
<OutputPath>bin\Debug\</OutputPath>
21-
<DefineConstants>DEBUG;TRACE</DefineConstants>
22-
<ErrorReport>prompt</ErrorReport>
23-
<WarningLevel>4</WarningLevel>
24-
</PropertyGroup>
25-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26-
<DebugType>pdbonly</DebugType>
27-
<Optimize>true</Optimize>
28-
<OutputPath>bin\Release\</OutputPath>
29-
<DefineConstants>TRACE</DefineConstants>
30-
<ErrorReport>prompt</ErrorReport>
31-
<WarningLevel>4</WarningLevel>
32-
</PropertyGroup>
33-
<ItemGroup>
34-
<Reference Include="CorrelatorSharp, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
35-
<HintPath>..\packages\CorrelatorSharp.1.1.0\lib\net46\CorrelatorSharp.dll</HintPath>
36-
<Private>True</Private>
37-
</Reference>
38-
<Reference Include="RestSharp, Version=105.2.3.0, Culture=neutral, processorArchitecture=MSIL">
39-
<HintPath>..\packages\RestSharp.105.2.3\lib\net46\RestSharp.dll</HintPath>
40-
<Private>True</Private>
41-
</Reference>
42-
<Reference Include="System" />
43-
</ItemGroup>
44-
<ItemGroup>
45-
<Compile Include="IRestClientCorrelationIdHeaderExtensions.cs" />
46-
<Compile Include="IRestRequestCorrelationIdHeaderExtensions.cs" />
47-
<Compile Include="Properties\AssemblyInfo.cs" />
48-
</ItemGroup>
19+
4920
<ItemGroup>
50-
<None Include="CorrelatorSharp.RestSharp.nuspec" />
51-
<None Include="packages.config" />
21+
<PackageReference Include="CorrelatorSharp" Version="[1.4,2)" />
22+
<PackageReference Include="RestSharp" Version="[106.2,107)" />
5223
</ItemGroup>
53-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
54-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
55-
Other similar extension points exist, see Microsoft.Common.targets.
56-
<Target Name="BeforeBuild">
57-
</Target>
58-
<Target Name="AfterBuild">
59-
</Target>
60-
-->
61-
</Project>
24+
25+
</Project>

CorrelatorSharp.RestSharp/CorrelatorSharp.RestSharp.nuspec

Lines changed: 0 additions & 19 deletions
This file was deleted.

CorrelatorSharp.RestSharp/IRestClientCorrelationIdHeaderExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System;
2-
using RestSharp;
1+
using RestSharp;
32

43
namespace CorrelatorSharp.RestSharp
54
{
@@ -14,7 +13,8 @@ public static class IRestClientCorrelationIdHeaderExtensions
1413
/// <param name="client">The RestSharp.IRestClient</param>
1514
public static void AddCorrelationHeader(this IRestClient client)
1615
{
17-
client.AddDefaultHeader(Headers.CorrelationId, ActivityScope.Current?.Id ?? Guid.NewGuid().ToString());
16+
var scope = ActivityScope.Current ?? ActivityScope.New(client.BaseUrl.ToString());
17+
client.AddDefaultHeader(Headers.CorrelationId, scope.Id);
1818
}
1919
}
2020
}

CorrelatorSharp.RestSharp/IRestRequestCorrelationIdHeaderExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System;
2-
using RestSharp;
1+
using RestSharp;
32

43
namespace CorrelatorSharp.RestSharp
54
{
@@ -11,7 +10,8 @@ public static class IRestRequestCorrelationIdHeaderExtensions
1110
/// <param name="request">The RestSharp.RestRequest</param>
1211
public static void AddCorrelationHeader(this IRestRequest request)
1312
{
14-
request.AddHeader(Headers.CorrelationId, ActivityScope.Current?.Id ?? Guid.NewGuid().ToString());
13+
var scope = ActivityScope.Current ?? ActivityScope.New(request.Resource);
14+
request.AddHeader(Headers.CorrelationId, scope.Id);
1515
}
1616
}
1717
}

CorrelatorSharp.RestSharp/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 37 deletions
This file was deleted.

CorrelatorSharp.RestSharp/packages.config

Lines changed: 0 additions & 5 deletions
This file was deleted.

appveyor.yml

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,39 @@
11
environment:
2-
release_version: '1.1.0'
3-
release_assembly_version: '1.1.0.0'
4-
5-
version: '$(release_version)+{build}'
6-
os: Visual Studio 2015
7-
configuration: Release
8-
platform: Any CPU
9-
assembly_info:
2+
package_version: '1.2.0'
3+
assembly_version: '1.1.0.0'
4+
5+
version: '$(package_version)+{build}'
6+
7+
image: Visual Studio 2017
8+
9+
dotnet_csproj:
1010
patch: true
11-
file: '**\AssemblyInfo.*'
12-
assembly_version: '$(release_assembly_version)'
13-
assembly_file_version: '$(release_assembly_version)'
14-
assembly_informational_version: '$(release_version)'
15-
before_build:
16-
- cmd: >-
17-
nuget restore
11+
file: '**\*.csproj'
12+
version: '$(package_version)'
13+
assembly_version: '$(assembly_version)'
14+
15+
configuration: Release
16+
17+
before_build: dotnet restore
18+
1819
build:
1920
publish_nuget: true
2021
publish_nuget_symbols: true
2122
verbosity: minimal
22-
test:
23-
assemblies: '**\*.Tests.dll'
24-
artifacts:
25-
- path: \*.nupkg
23+
2624
deploy:
27-
- provider: NuGet
28-
api_key:
29-
secure: vZC+uEZj00A+9riSWLXqdnPtGa96W9SQkBy30dS2D5bOUdvteU9vOAP69QLJrY/o
30-
on:
31-
branch: master
25+
- provider: GitHub
26+
description: |
27+
* .NET Standard 2.0+ support.
28+
on:
29+
appveyor_repo_tag: true
30+
31+
release: v$(package_version)
32+
auth_token:
33+
secure: y4HfARa+GScoSgdsOIb7A3L8TV93/wiPBgJENisycZ6yKwBANmPEe1MesK4IC6rm
34+
35+
- provider: NuGet
36+
api_key:
37+
secure: vZC+uEZj00A+9riSWLXqdnPtGa96W9SQkBy30dS2D5bOUdvteU9vOAP69QLJrY/o
38+
on:
39+
appveyor_repo_tag: true

0 commit comments

Comments
 (0)