Skip to content

Commit

Permalink
Merge pull request #17 from NLog/net40_netstandard2
Browse files Browse the repository at this point in the history
 .NET 4+ and .NET Standard 2 support + updated dependencies
  • Loading branch information
304NotModified authored Oct 10, 2017
2 parents 84c8e77 + e4e759b commit ce67f5f
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 23 deletions.
4 changes: 4 additions & 0 deletions src/NLog.MailKit/MailTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,8 @@ protected override void Write(AsyncLogEventInfo logEvent)
Write((IList<AsyncLogEventInfo>)new[] { logEvent });
}

#if !NETSTANDARD2_0

/// <summary>
/// NOTE! Will soon be marked obsolete. Instead override Write(IList{AsyncLogEventInfo} logEvents)
///
Expand All @@ -266,6 +268,8 @@ protected override void Write(AsyncLogEventInfo[] logEvents)
Write((IList<AsyncLogEventInfo>)logEvents);
}

#endif

/// <summary>
/// Renders an array logging events.
/// </summary>
Expand Down
49 changes: 30 additions & 19 deletions src/NLog.MailKit/NLog.MailKit.csproj
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.4</TargetFramework>
<Version>1.1.1</Version>
<TargetFrameworks>netstandard1.4;net40;netstandard2.0</TargetFrameworks>
<Version>2.0</Version>
<Authors>Julian Verdurmen</Authors>
<Company>NLog</Company>
<Description>
NLog Mail Target for .NET Core, using MailKit.
<Description>NLog Mail Target for .NET Core, using MailKit.

As System.Net.Mail isn't ported to .NET Core (yet), the original Mail Target of NLog isn't working when using .NET Core.
As System.Net.Mail isn't ported to .NET Core (yet), the original Mail Target of NLog isn't working when using .NET Core.

This package add the mail target to NLog and has the same options as the original Mail Target.
This package add the mail target to NLog and has the same options as the original Mail Target.

Compared to the original MailTarget, the following options aren't implemented:
Compared to the original MailTarget, the following options aren't implemented:

- PickupDirectory
- NTLM auth
</Description>
- PickupDirectory
- NTLM auth
</Description>
<PackageProjectUrl>https://github.com/NLog/NLog.MailKit</PackageProjectUrl>
<PackageLicenseUrl>https://raw.githubusercontent.com/NLog/NLog.MailKit/master/LICENSE</PackageLicenseUrl>
<PackageIconUrl>http://nlog-project.org/N.png</PackageIconUrl>
Expand All @@ -26,21 +25,33 @@
<AssemblyOriginatorKeyFile>NLog.snk</AssemblyOriginatorKeyFile>
<DelaySign>False</DelaySign>
<PackageReleaseNotes>
1.1.1: Updated dependencies
1.1.0: Added SkipCertificateValidation option
</PackageReleaseNotes>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
2.0: .NET 4+ and .NET standard 2 support.

Small breaking change, SmtpAuthenticationMode has been moved to this dll.

1.1.1: Updated dependencies
1.1.0: Added SkipCertificateValidation option
</PackageReleaseNotes>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<!--AssemblyVersion: keep 1.0.0.0-->
<FileVersion>0.1.0.0</FileVersion>
<FileVersion>2.0.0.0</FileVersion>
<!-- FileVersion = AssemblyFileVersionAttribute, patched by AppVeyor -->
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>bin\Release\netstandard1.3\NLog.MailKit.xml</DocumentationFile>
<DocumentationFile>bin\Release\$(TargetFramework)\NLog.MailKit.xml</DocumentationFile>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;RELEASE</DefineConstants>
<DefineConstants>RELEASE</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MailKit" Version="1.16.2" />
<PackageReference Include="NLog" Version="5.0.0-beta09" />
<PackageReference Include="MailKit" Version="1.18.1.1" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net40' ">
<PackageReference Include="NLog" Version="4.4.12" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.4' ">
<PackageReference Include="NLog" Version="5.0.0-beta11" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="NLog" Version="4.5.0-beta03" />
</ItemGroup>
</Project>
27 changes: 27 additions & 0 deletions src/NLog.MailKit/SmtpAuthenticationMode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace NLog.MailKit
{
/// <summary>
/// SMTP authentication modes.
/// </summary>
public enum SmtpAuthenticationMode
{
/// <summary>
/// No authentication.
/// </summary>
None,

/// <summary>
/// Basic - username and password.
/// </summary>
Basic,

/// <summary>
/// NTLM Authentication.
/// </summary>
Ntlm,
}
}
8 changes: 4 additions & 4 deletions test/NLog.MailKit.Tests/NLog.MailKit.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<TargetFrameworks>netcoreapp1.1;net461;netcoreapp2.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0-preview-20171009-10" />
<PackageReference Include="SmtpServer" Version="2.2.0" />
<PackageReference Include="xunit" Version="2.2.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
<PackageReference Include="xunit" Version="2.3.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit ce67f5f

Please sign in to comment.