Skip to content

Commit

Permalink
Merge pull request #94 from snakefoot/NetStandard2
Browse files Browse the repository at this point in the history
Added NetStandard2.0 target framework to reduce dependencies for NetCore
  • Loading branch information
guptakeshav-sumo authored Jan 6, 2020
2 parents 073ea05 + 0606a8e commit 80015c1
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</PropertyGroup>
<ItemGroup>
<Folder Include="wwwroot\" />
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.9" />
<PackageReference Include="Microsoft.AspNetCore.All" />
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.4" />
<ProjectReference Include="..\SumoLogic.Logging.AspNetCore\SumoLogic.Logging.AspNetCore.csproj" />
</ItemGroup>
Expand Down
6 changes: 5 additions & 1 deletion SumoLogic.Logging.Common/Sender/SumoLogicMessageSender.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,11 @@ public async Task Send(string body, string name, string category, string host)
}
catch (Exception ex)
{
if (!(ex is IOException || ex is HttpRequestException || ex is WebException))
#if NETSTANDARD
if (!(ex is IOException || ex is HttpRequestException))
#else
if (!(ex is IOException || ex is HttpRequestException || ex is System.Net.WebException))
#endif
{
throw;
}
Expand Down
27 changes: 11 additions & 16 deletions SumoLogic.Logging.Common/SumoLogic.Logging.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<Description>Shared library used by .NET log appenders uploading to Sumo Logic.</Description>
<Authors>Sumo Logic</Authors>
<Copyright>Copyright © 2018 Sumo Logic Inc. - All Rights Reserved</Copyright>
<TargetFrameworks>netstandard1.3;net45</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard1.3;net45</TargetFrameworks>
<SignAssembly Condition="'$(Configuration)' == 'Release' ">true</SignAssembly>
<AssemblyOriginatorKeyFile>..\SumoLogic.Logging.snk</AssemblyOriginatorKeyFile>
<NetStandardImplicitPackageVersion>1.6.0</NetStandardImplicitPackageVersion>
<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.3' ">1.6.0</NetStandardImplicitPackageVersion>
<PackageProjectUrl>https://github.com/SumoLogic/sumologic-net-appenders</PackageProjectUrl>
<PackageIconUrl>https://raw.githubusercontent.com/SumoLogic/sumologic-net-appenders/master/icon.png</PackageIconUrl>
<RepositoryUrl>https://github.com/SumoLogic/sumologic-net-appenders</RepositoryUrl>
Expand All @@ -16,20 +16,15 @@
<RepositoryType>git</RepositoryType>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net45' ">
<DefineConstants>netfull</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
<DefineConstants>netstandard</DefineConstants>
</PropertyGroup>
<ItemGroup>
<None Include="..\SumoLogic.Logging.snk">
<Link>SumoLogic.Logging.snk</Link>
</None>
<CodeAnalysisDictionary Include="..\CustomDictionary.xml">
<Link>CustomDictionary.xml</Link>
</CodeAnalysisDictionary>
<PackageReference Include="System.Net.Http" Version="4.3.1" />
<PackageReference Include="System.Net.Requests" Version="4.3.0" />
<None Include="..\SumoLogic.Logging.snk">
<Link>SumoLogic.Logging.snk</Link>
</None>
<CodeAnalysisDictionary Include="..\CustomDictionary.xml">
<Link>CustomDictionary.xml</Link>
</CodeAnalysisDictionary>
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' != 'netstandard2.0' ">
<PackageReference Include="System.Net.Http" Version="4.3.1" />
</ItemGroup>
</Project>
11 changes: 2 additions & 9 deletions SumoLogic.Logging.Log4Net/SumoLogic.Logging.Log4Net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<Description>Log4Net appender which sends logs to the Sumo Logic machine data analytics platform.</Description>
<Authors>Sumo Logic</Authors>
<Copyright>Copyright © 2018 Sumo Logic Inc. - All Rights Reserved</Copyright>
<TargetFrameworks>netstandard1.3;net45</TargetFrameworks>
<TargetFrameworks>net45;netstandard1.3</TargetFrameworks>
<SignAssembly Condition="'$(Configuration)' == 'Release' ">true</SignAssembly>
<AssemblyOriginatorKeyFile>..\SumoLogic.Logging.snk</AssemblyOriginatorKeyFile>
<NetStandardImplicitPackageVersion>1.6.0</NetStandardImplicitPackageVersion>
<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.3' ">1.6.0</NetStandardImplicitPackageVersion>
<PackageProjectUrl>https://github.com/SumoLogic/sumologic-net-appenders</PackageProjectUrl>
<PackageIconUrl>https://raw.githubusercontent.com/SumoLogic/sumologic-net-appenders/master/icon.png</PackageIconUrl>
<RepositoryUrl>https://github.com/SumoLogic/sumologic-net-appenders</RepositoryUrl>
Expand All @@ -16,12 +16,6 @@
<RepositoryType>git</RepositoryType>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net45' ">
<DefineConstants>netfull</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
<DefineConstants>netstandard</DefineConstants>
</PropertyGroup>
<ItemGroup>
<None Include="..\SumoLogic.Logging.snk">
<Link>SumoLogic.Logging.snk</Link>
Expand All @@ -31,6 +25,5 @@
</CodeAnalysisDictionary>
<ProjectReference Include="..\SumoLogic.Logging.Common\SumoLogic.Logging.Common.csproj"></ProjectReference>
<PackageReference Include="log4net" Version="2.0.8" />
<PackageReference Include="System.Net.Http" Version="4.3.1" />
</ItemGroup>
</Project>
11 changes: 2 additions & 9 deletions SumoLogic.Logging.NLog/SumoLogic.Logging.NLog.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<Description>NLog appender which sends logs to the Sumo Logic machine data platform.</Description>
<Authors>Sumo Logic</Authors>
<Copyright>Copyright © 2018 Sumo Logic Inc. - All Rights Reserved</Copyright>
<TargetFrameworks>net45;netstandard1.3</TargetFrameworks>
<TargetFrameworks>net45;netstandard1.3;netstandard2.0</TargetFrameworks>
<SignAssembly Condition="'$(Configuration)' == 'Release' ">true</SignAssembly>
<AssemblyOriginatorKeyFile>..\SumoLogic.Logging.snk</AssemblyOriginatorKeyFile>
<NetStandardImplicitPackageVersion>1.6.0</NetStandardImplicitPackageVersion>
<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.3' ">1.6.0</NetStandardImplicitPackageVersion>
<PackageProjectUrl>https://github.com/SumoLogic/sumologic-net-appenders</PackageProjectUrl>
<PackageIconUrl>https://raw.githubusercontent.com/SumoLogic/sumologic-net-appenders/master/icon.png</PackageIconUrl>
<RepositoryUrl>https://github.com/SumoLogic/sumologic-net-appenders</RepositoryUrl>
Expand All @@ -16,12 +16,6 @@
<RepositoryType>git</RepositoryType>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net45' ">
<DefineConstants>netfull</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
<DefineConstants>netstandard</DefineConstants>
</PropertyGroup>
<ItemGroup>
<None Include="..\SumoLogic.Logging.snk">
<Link>SumoLogic.Logging.snk</Link>
Expand All @@ -31,6 +25,5 @@
</CodeAnalysisDictionary>
<ProjectReference Include="..\SumoLogic.Logging.Common\SumoLogic.Logging.Common.csproj" />
<PackageReference Include="NLog" Version="4.5.11" />
<PackageReference Include="System.Net.Http" Version="4.3.1" />
</ItemGroup>
</Project>
11 changes: 2 additions & 9 deletions SumoLogic.Logging.Serilog/SumoLogic.Logging.Serilog.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<Description>Serilog sink which sends logs to the Sumo Logic machine data analytics platform.</Description>
<Authors>Sumo Logic</Authors>
<Copyright>Copyright © 2018 Sumo Logic Inc. - All Rights Reserved</Copyright>
<TargetFrameworks>net45;netstandard1.3</TargetFrameworks>
<TargetFrameworks>net45;netstandard1.3;;netstandard2.0</TargetFrameworks>
<SignAssembly Condition="'$(Configuration)' == 'Release' ">true</SignAssembly>
<AssemblyOriginatorKeyFile>..\SumoLogic.Logging.snk</AssemblyOriginatorKeyFile>
<NetStandardImplicitPackageVersion>1.6.0</NetStandardImplicitPackageVersion>
<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.3' ">1.6.0</NetStandardImplicitPackageVersion>
<PackageProjectUrl>https://github.com/SumoLogic/sumologic-net-appenders</PackageProjectUrl>
<PackageIconUrl>https://raw.githubusercontent.com/SumoLogic/sumologic-net-appenders/master/icon.png</PackageIconUrl>
<RepositoryUrl>https://github.com/SumoLogic/sumologic-net-appenders</RepositoryUrl>
Expand All @@ -16,12 +16,6 @@
<RepositoryType>git</RepositoryType>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net45' ">
<DefineConstants>netfull</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
<DefineConstants>netstandard</DefineConstants>
</PropertyGroup>
<ItemGroup>
<None Include="..\SumoLogic.Logging.snk">
<Link>SumoLogic.Logging.snk</Link>
Expand All @@ -31,6 +25,5 @@
</CodeAnalysisDictionary>
<ProjectReference Include="..\SumoLogic.Logging.Common\SumoLogic.Logging.Common.csproj" />
<PackageReference Include="Serilog" Version="[2.0,3.0)" />
<PackageReference Include="System.Net.Http" Version="4.3.1" />
</ItemGroup>
</Project>

0 comments on commit 80015c1

Please sign in to comment.