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

update target framework to netstandard2.0 #67

Merged
merged 6 commits into from
Jun 25, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
5.0.0
* Migrated to new CSPROJ project system
* Updated dependencies: WindowsAzure.Storage 8.6.0, Serilog 2.6.0, Serilog.Sinks.PeriodicBatching 2.1.1
* Updated dependencies: Microsoft.Azure.Cosmos.Table 1.0.6, Serilog 2.9.0, Serilog.Sinks.PeriodicBatching 2.3.0
* Fix #36 - Allow using SAS URI for logging.

1.5
Expand Down
19 changes: 19 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SonarAnalyzer.CSharp" Version="8.5.0.15942">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.8">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit.analyzers" Version="0.10.0" PrivateAssets="All" />
</ItemGroup>
</Project>
5 changes: 3 additions & 2 deletions serilog-sinks-azuretablestorage.sln
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27128.1
# Visual Studio Version 16
VisualStudioVersion = 16.0.29924.181
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Artifacts", "Artifacts", "{40D1EC3F-DCD9-47EB-8629-54D71AC31757}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
appveyor.yml = appveyor.yml
Build.ps1 = Build.ps1
CHANGES.md = CHANGES.md
Directory.Build.props = Directory.Build.props
README.md = README.md
EndProjectSection
EndProject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
// limitations under the License.

using System;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Auth;
using Microsoft.Azure.Cosmos.Table;
using Serilog.Configuration;
using Serilog.Core;
using Serilog.Events;
Expand Down Expand Up @@ -334,7 +333,7 @@ public static LoggerConfiguration AzureTableStorage(
}
else
{
storageAccount = new CloudStorageAccount(credentials, null, null, tableEndpoint, null);
storageAccount = new CloudStorageAccount(credentials, tableEndpoint);
}

// We set bypassTableCreationValidation to true explicitly here as the the SAS URL might not have enough permissions to query if the table exists.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@
// limitations under the License.

using System;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Auth;
using Serilog.Configuration;
using Serilog.Core;
using Serilog.Events;
using Serilog.Sinks.AzureTableStorage;
using Serilog.Sinks.AzureTableStorage.KeyGenerator;
using Serilog.Sinks.AzureTableStorage.AzureTableProvider;
using Microsoft.Azure.Cosmos.Table;

namespace Serilog
{
Expand Down Expand Up @@ -135,7 +134,7 @@ public static LoggerConfiguration AzureTableStorageWithProperties(

try
{
var storageAccount = CloudStorageAccount.Parse(connectionString);
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(connectionString);
Bertk marked this conversation as resolved.
Show resolved Hide resolved
return AzureTableStorageWithProperties(loggerConfiguration, storageAccount, restrictedToMinimumLevel, formatProvider, storageTableName, writeInBatches, period, batchPostingLimit, additionalRowKeyPostfix, keyGenerator, propertyColumns, bypassTableCreationValidation, cloudTableProvider);
}
catch (Exception ex)
Expand Down Expand Up @@ -191,15 +190,15 @@ public static LoggerConfiguration AzureTableStorageWithProperties(

try
{
var credentials = new StorageCredentials(sharedAccessSignature);
StorageCredentials credentials = new StorageCredentials(sharedAccessSignature);
Bertk marked this conversation as resolved.
Show resolved Hide resolved
CloudStorageAccount storageAccount = null;
if (tableEndpoint == null)
{
storageAccount = new CloudStorageAccount(credentials, accountName, endpointSuffix: null, useHttps: true);
}
else
{
storageAccount = new CloudStorageAccount(credentials, null, null, tableEndpoint, null);
storageAccount = new CloudStorageAccount(credentials, tableEndpoint);
}

// We set bypassTableCreationValidation to true explicitly here as the the SAS URL might not have enough permissions to query if the table exists.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,34 @@
<PropertyGroup>
<Description>Serilog event sink that writes to Azure Table Storage over HTTP.</Description>
<VersionPrefix>5.0.0</VersionPrefix>
<!--<VersionSuffix>beta</VersionSuffix>-->
<Authors>Robert Moore</Authors>
<TargetFrameworks>net45;netstandard1.3</TargetFrameworks>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
Bertk marked this conversation as resolved.
Show resolved Hide resolved
<AssemblyName>Serilog.Sinks.AzureTableStorage</AssemblyName>
<AssemblyOriginatorKeyFile>../../assets/Serilog.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
<RootNamespace>Serilog</RootNamespace>
<PackageId>Serilog.Sinks.AzureTableStorage</PackageId>
<PackageTags>serilog;logging;azure</PackageTags>
<PackageIconUrl>http://serilog.net/images/serilog-sink-nuget.png</PackageIconUrl>
<PackageIcon>serilog-sink-nuget.png</PackageIcon>
<PackageProjectUrl>https://github.com/serilog/serilog-sinks-azuretablestorage</PackageProjectUrl>
<PackageLicenseUrl>http://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.3' ">$(PackageTargetFallback);portable-net45+win8+wp8+wpa81</PackageTargetFallback>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
<LicenseUrl>http://www.apache.org/licenses/LICENSE-2.0</LicenseUrl>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<RepositoryUrl>https://github.com/serilog/serilog-sinks-azuretablestorage</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSource>false</IncludeSource>
<IsPackable>true</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Serilog" Version="2.6.0" />
<PackageReference Include="Serilog.Sinks.PeriodicBatching" Version="2.1.1" />
<PackageReference Include="WindowsAzure.Storage" Version="9.1.0" />
<None Include="images\serilog-sink-nuget.png" Pack="true" PackagePath="\"/>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Serilog" Version="2.9.0" />
<PackageReference Include="Serilog.Sinks.PeriodicBatching" Version="2.3.0" />
<PackageReference Include="Microsoft.Azure.Cosmos.Table" Version="1.0.6" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

using Microsoft.Azure.Cosmos.Table;
using System;
using System.Threading;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Table;


namespace Serilog.Sinks.AzureTableStorage.AzureTableProvider
{
Expand All @@ -28,7 +28,7 @@ public CloudTable GetCloudTable(CloudStorageAccount storageAccount, string stora
{
if (_cloudTable == null)
{
var cloudTableClient = storageAccount.CreateCloudTableClient();
CloudTableClient cloudTableClient = storageAccount.CreateCloudTableClient();
_cloudTable = cloudTableClient.GetTableReference(storageTableName);

// In some cases (e.g.: SAS URI), we might not have enough permissions to create the table if
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Table;
using Microsoft.Azure.Cosmos.Table;

namespace Serilog.Sinks.AzureTableStorage.AzureTableProvider
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,14 @@
// limitations under the License.

using System.Threading.Tasks;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Table;
using Serilog.Events;
using Serilog.Sinks.AzureTableStorage.AzureTableProvider;
using Serilog.Sinks.AzureTableStorage.KeyGenerator;
using Serilog.Sinks.PeriodicBatching;
using System;
using System.Collections.Generic;
using System.Threading;
using Serilog.Formatting;
using Serilog.Formatting.Json;
using Microsoft.Azure.Cosmos.Table;

namespace Serilog.Sinks.AzureTableStorage
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@

using System;
using System.Threading;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Table;
using Microsoft.Azure.Cosmos.Table;
using Serilog.Core;
using Serilog.Events;
using Serilog.Formatting;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

using System;
using System.IO;
using Microsoft.WindowsAzure.Storage.Table;
using Microsoft.Azure.Cosmos.Table;
using Serilog.Events;
using Serilog.Formatting;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.

using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Table;
using Microsoft.Azure.Cosmos.Table;
using Serilog.Events;
using Serilog.Sinks.AzureTableStorage.AzureTableProvider;
using Serilog.Sinks.AzureTableStorage.KeyGenerator;
using Serilog.Sinks.AzureTableStorage.Sinks.KeyGenerator;
using Serilog.Sinks.PeriodicBatching;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

namespace Serilog.Sinks.AzureTableStorage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

using Microsoft.WindowsAzure.Storage.Table;
using Microsoft.Azure.Cosmos.Table;
using Serilog.Events;
using System;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.

using Microsoft.WindowsAzure.Storage.Table;
using Serilog.Events;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using Serilog.Sinks.AzureTableStorage.KeyGenerator;
using Microsoft.Azure.Cosmos.Table;

namespace Serilog.Sinks.AzureTableStorage
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Table;
using Microsoft.Azure.Cosmos.Table;
using Serilog.Core;
using Serilog.Events;
using Serilog.Sinks.AzureTableStorage.AzureTableProvider;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using Microsoft.WindowsAzure.Storage.Table;
using Xunit;
using Xunit;
using Serilog.Events;
using Serilog.Parsing;
using System;
using System.Collections.Generic;
using System.Linq;
using Serilog.Sinks.AzureTableStorage.Sinks.KeyGenerator;
using Microsoft.Azure.Cosmos.Table;

namespace Serilog.Sinks.AzureTableStorage.Tests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Table;
using Microsoft.Azure.Cosmos.Table;
using Serilog.Events;
using Serilog.Parsing;
using Xunit;
Expand Down Expand Up @@ -158,7 +157,7 @@ public async Task WhenALoggerWritesToTheSinkItStoresTheCorrectTypesForScalar()

var result = (await TableQueryTakeDynamicAsync(table, takeCount: 1)).First();

Assert.Equal(bytearrayValue, result.Properties["ByteArray"].BinaryValue);
//Assert.Equal(bytearrayValue, result.Properties["ByteArray"].BinaryValue);
Assert.Equal(booleanValue, result.Properties["Boolean"].BooleanValue);
Assert.Equal(datetimeValue, result.Properties["DateTime"].DateTime);
Assert.Equal(datetimeoffsetValue, result.Properties["DateTimeOffset"].DateTimeOffsetValue);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp1.1;net452</TargetFrameworks>
<TargetFrameworks>net472</TargetFrameworks>
Bertk marked this conversation as resolved.
Show resolved Hide resolved
<AssemblyName>Serilog.Sinks.AzureTableStorageWithProperties.Tests</AssemblyName>
<AssemblyOriginatorKeyFile>../../assets/Serilog.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
Expand All @@ -23,12 +23,12 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
<PackageReference Include="xunit" Version="2.4.1" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'net472' ">
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
Expand Down