From a588484444b9128f253c9d9ac24f954e52b0e505 Mon Sep 17 00:00:00 2001 From: Nicolas Coderre Date: Thu, 24 Dec 2015 16:14:42 -0800 Subject: [PATCH 1/2] added UAP10.0 target --draft, missing AsyncRewrite dependency. following advice from https://oren.codes/2015/07/29/targeting-net-core/ --- src/Npgsql/Common.cs | 2 +- src/Npgsql/Npgsql.xproj | 2 +- src/Npgsql/NpgsqlCommand.cs | 2 +- src/Npgsql/NpgsqlConnection.cs | 2 +- src/Npgsql/NpgsqlConnector.cs | 4 ++-- src/Npgsql/NpgsqlParameter.cs | 2 +- src/Npgsql/project.json | 40 +++++++++++++++++++++++++++++----- 7 files changed, 42 insertions(+), 12 deletions(-) diff --git a/src/Npgsql/Common.cs b/src/Npgsql/Common.cs index e2bcf83a4a..0994a9b569 100644 --- a/src/Npgsql/Common.cs +++ b/src/Npgsql/Common.cs @@ -149,7 +149,7 @@ enum ByteOrder #region Component model attributes missing from CoreCLR -#if DNXCORE50 || DOTNET +#if DNXCORE50 || UAP10_0 || DOTNET [AttributeUsage(AttributeTargets.Property)] class DisplayNameAttribute : Attribute { diff --git a/src/Npgsql/Npgsql.xproj b/src/Npgsql/Npgsql.xproj index 9c3cbef64f..8180f13ef0 100644 --- a/src/Npgsql/Npgsql.xproj +++ b/src/Npgsql/Npgsql.xproj @@ -6,7 +6,7 @@ - 9d13b739-62b1-4190-b386-7a9547304eb3 + 89d1d4af-cad8-481f-9d5f-eaa2c9a2ccba diff --git a/src/Npgsql/NpgsqlCommand.cs b/src/Npgsql/NpgsqlCommand.cs index 1c00b8303e..9ee84e0384 100644 --- a/src/Npgsql/NpgsqlCommand.cs +++ b/src/Npgsql/NpgsqlCommand.cs @@ -49,7 +49,7 @@ namespace Npgsql #if WITHDESIGN [System.Drawing.ToolboxBitmapAttribute(typeof(NpgsqlCommand)), ToolboxItem(true)] #endif -#if DNXCORE50 || DOTNET +#if DNXCORE50 || UAP10_0 || DOTNET public sealed partial class NpgsqlCommand : DbCommand #else // ReSharper disable once RedundantNameQualifier diff --git a/src/Npgsql/NpgsqlConnection.cs b/src/Npgsql/NpgsqlConnection.cs index 1afddb4ea0..933cd40b6a 100644 --- a/src/Npgsql/NpgsqlConnection.cs +++ b/src/Npgsql/NpgsqlConnection.cs @@ -50,7 +50,7 @@ namespace Npgsql #if WITHDESIGN [System.Drawing.ToolboxBitmapAttribute(typeof(NpgsqlConnection))] #endif -#if DNXCORE50 || DOTNET +#if DNXCORE50 || UAP10_0 || DOTNET public sealed partial class NpgsqlConnection : DbConnection #else // ReSharper disable once RedundantNameQualifier diff --git a/src/Npgsql/NpgsqlConnector.cs b/src/Npgsql/NpgsqlConnector.cs index 3ef17e8333..0d3f69fb8e 100644 --- a/src/Npgsql/NpgsqlConnector.cs +++ b/src/Npgsql/NpgsqlConnector.cs @@ -518,7 +518,7 @@ void RawOpen(NpgsqlTimeout timeout) else { var sslStream = new SslStream(_stream, false, certificateValidationCallback); -#if DNXCORE50 +#if DNXCORE50 || UAP10_0 // CoreCLR removed sync methods from SslStream, see https://github.com/dotnet/corefx/pull/4868. // Consider exactly what to do here. sslStream.AuthenticateAsClientAsync(Host, clientCertificates, SslProtocols.Tls | SslProtocols.Tls11 | SslProtocols.Tls12, false).Wait(); @@ -660,7 +660,7 @@ async Task ConnectAsync(NpgsqlTimeout timeout, CancellationToken cancellationTok Log.Trace("Attempting to connect to " + ips[i], Id); var ep = new IPEndPoint(ips[i], Port); var socket = new Socket(ep.AddressFamily, SocketType.Stream, ProtocolType.Tcp); -#if DNXCORE50 +#if DNXCORE50 || UAP10_0 var connectTask = socket.ConnectAsync(ep); #else var connectTask = Task.Factory.FromAsync(socket.BeginConnect, socket.EndConnect, ep, null); diff --git a/src/Npgsql/NpgsqlParameter.cs b/src/Npgsql/NpgsqlParameter.cs index 0da8292255..c12246ed6f 100644 --- a/src/Npgsql/NpgsqlParameter.cs +++ b/src/Npgsql/NpgsqlParameter.cs @@ -42,7 +42,7 @@ namespace Npgsql #if WITHDESIGN [TypeConverter(typeof(NpgsqlParameterConverter))] #endif -#if DNXCORE50 || DOTNET +#if DNXCORE50 || UAP10_0 || DOTNET public sealed class NpgsqlParameter : DbParameter #else public sealed class NpgsqlParameter : DbParameter, ICloneable diff --git a/src/Npgsql/project.json b/src/Npgsql/project.json index a155812c31..1adda37749 100644 --- a/src/Npgsql/project.json +++ b/src/Npgsql/project.json @@ -34,16 +34,12 @@ "keyFile": "../../Npgsql.snk" }, "commands": { - "rewrite-async": "AsyncRewriter" }, "scripts": { - "prebuild": [ - "dnx rewrite-async" - ] }, "dependencies": { - "AsyncRewriter": { "version": "0.7.8", "type": "build" } }, + "runtimes": {"win": {}}, "frameworks": { "net45": { "frameworkAssemblies": { @@ -111,6 +107,40 @@ "System.Threading.Thread": "4.0.0-*", "System.Threading.Timer": "4.0.1-*" } + }, + "uap10.0": { + "dependencies": { + "System.Collections.Concurrent": "4.0.11-*", + "System.Console": "4.0.0-*", + "System.ComponentModel": "4.0.1-*", + "System.ComponentModel.TypeConverter": "4.0.1-*", + "System.Data.Common": "4.0.1-*", + "System.Diagnostics.Contracts": "4.0.1-*", + "System.Diagnostics.Tools": "4.0.1-*", + "System.Globalization": "4.0.11-*", + "System.Globalization.Extensions": "4.0.1-*", + "System.Linq": "4.0.1-*", + "System.Net.NameResolution": "4.0.0-*", + "System.Net.Primitives": "4.0.11-*", + "System.Net.Sockets": "4.1.0-*", + "System.Net.Security": "4.0.0-*", + "System.Net.NetworkInformation": "4.1.0-*", + "System.Runtime": "4.0.21-*", + "System.Runtime.Extensions": "4.0.11-*", + "System.Runtime.InteropServices": "4.0.21-*", + "System.Runtime.Numerics": "4.0.1-*", + "System.Reflection": "4.1.0-*", + "System.Reflection.TypeExtensions": "4.0.1-*", + "System.Security.Cryptography.Primitives": "4.0.0-*", + "System.Security.Cryptography.Algorithms": "4.0.0-*", + "System.Security.Cryptography.X509Certificates": "4.0.0-*", + "System.Security.Principal": "4.0.1-*", + "System.Text.Encoding.Extensions": "4.0.11-*", + "System.Text.RegularExpressions": "4.0.11-*", + "System.Threading": "4.0.11-*", + "System.Threading.Thread": "4.0.0-*", + "System.Threading.Timer": "4.0.1-*" + } } } } From 5dabe7583842cbad3a383635f48e47ceffa6e2c8 Mon Sep 17 00:00:00 2001 From: Nicolas Coderre Date: Thu, 24 Dec 2015 16:26:57 -0800 Subject: [PATCH 2/2] get rid of: Error Assembly 'Npgsql' with identity 'Npgsql, Version=3.1.0.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7' uses 'System.Data.Common, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version than referenced assembly 'System.Data.Common' with identity 'System.Data.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' DataAccess D:\Users\ncoder\code\ChainOfCommand\DataAccess\CSC When linking to a UAP10.0 project in visual studio 2015 --- src/Npgsql/project.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Npgsql/project.json b/src/Npgsql/project.json index 1adda37749..a2fe37d485 100644 --- a/src/Npgsql/project.json +++ b/src/Npgsql/project.json @@ -114,7 +114,7 @@ "System.Console": "4.0.0-*", "System.ComponentModel": "4.0.1-*", "System.ComponentModel.TypeConverter": "4.0.1-*", - "System.Data.Common": "4.0.1-*", + "System.Data.Common": "4.0.0-*", "System.Diagnostics.Contracts": "4.0.1-*", "System.Diagnostics.Tools": "4.0.1-*", "System.Globalization": "4.0.11-*",