From 4d095ca2e9ef7b162b74a7432c8c372cdc75a8be Mon Sep 17 00:00:00 2001 From: Cheena Malhotra Date: Thu, 23 Jan 2020 08:08:07 -0800 Subject: [PATCH 1/3] CLS Compliance added to all projects --- .../netcore/ref/Microsoft.Data.SqlClient.cs | 1 + .../netfx/ref/Microsoft.Data.SqlClient.cs | 14 +++++++++++++- tools/targets/GenerateThisAssemblyCs.targets | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.cs b/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.cs index ae116a5286..dcd8f76303 100644 --- a/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.cs +++ b/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +[assembly: System.CLSCompliantAttribute(true)] namespace Microsoft.Data { /// diff --git a/src/Microsoft.Data.SqlClient/netfx/ref/Microsoft.Data.SqlClient.cs b/src/Microsoft.Data.SqlClient/netfx/ref/Microsoft.Data.SqlClient.cs index 359dffe1bd..2adee850cf 100644 --- a/src/Microsoft.Data.SqlClient/netfx/ref/Microsoft.Data.SqlClient.cs +++ b/src/Microsoft.Data.SqlClient/netfx/ref/Microsoft.Data.SqlClient.cs @@ -1,13 +1,17 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. - +[assembly: System.CLSCompliantAttribute(true)] namespace Microsoft.Data { /// + [System.Serializable] public sealed partial class OperationAbortedException : System.SystemException { internal OperationAbortedException() { } + + private OperationAbortedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } + } } namespace Microsoft.Data.Sql @@ -27,6 +31,7 @@ public sealed partial class SqlNotificationRequest public string UserData { get { throw null; } set { } } } } + namespace Microsoft.Data.SqlClient { /// @@ -1315,9 +1320,12 @@ public sealed partial class SqlErrorCollection : System.Collections.ICollection, public System.Collections.IEnumerator GetEnumerator() { throw null; } } /// + [System.Serializable] public sealed partial class SqlException : System.Data.Common.DbException { internal SqlException() { } + private SqlException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } + /// public byte Class { get { throw null; } } /// @@ -1708,10 +1716,14 @@ public interface IBinarySerialize /// void Write(System.IO.BinaryWriter w); } + /// + [System.Serializable] public sealed partial class InvalidUdtException : System.SystemException { internal InvalidUdtException() { } + private InvalidUdtException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } + } /// public partial class SqlDataRecord : System.Data.IDataRecord diff --git a/tools/targets/GenerateThisAssemblyCs.targets b/tools/targets/GenerateThisAssemblyCs.targets index 4d6f317f4f..7382db4317 100644 --- a/tools/targets/GenerateThisAssemblyCs.targets +++ b/tools/targets/GenerateThisAssemblyCs.targets @@ -8,6 +8,7 @@ BeforeTargets="CoreCompile"> +[assembly: System.CLSCompliantAttribute(true)] namespace System { internal static class ThisAssembly From 3aba2d116ec388a0688e9ae116a33aa95bce9d58 Mon Sep 17 00:00:00 2001 From: Cheena Malhotra Date: Thu, 23 Jan 2020 15:18:33 -0800 Subject: [PATCH 2/3] Remove attribute --- .../netcore/ref/Microsoft.Data.SqlClient.cs | 2 +- .../netfx/ref/Microsoft.Data.SqlClient.cs | 2 +- .../netfx/tools/targets/GenerateAssemblyInfo.targets | 2 +- tools/targets/GenerateThisAssemblyCs.targets | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.cs b/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.cs index dcd8f76303..dad5909a67 100644 --- a/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.cs +++ b/src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -[assembly: System.CLSCompliantAttribute(true)] +[assembly: System.CLSCompliant(true)] namespace Microsoft.Data { /// diff --git a/src/Microsoft.Data.SqlClient/netfx/ref/Microsoft.Data.SqlClient.cs b/src/Microsoft.Data.SqlClient/netfx/ref/Microsoft.Data.SqlClient.cs index 2adee850cf..8a9fa8429d 100644 --- a/src/Microsoft.Data.SqlClient/netfx/ref/Microsoft.Data.SqlClient.cs +++ b/src/Microsoft.Data.SqlClient/netfx/ref/Microsoft.Data.SqlClient.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -[assembly: System.CLSCompliantAttribute(true)] +[assembly: System.CLSCompliant(true)] namespace Microsoft.Data { /// diff --git a/src/Microsoft.Data.SqlClient/netfx/tools/targets/GenerateAssemblyInfo.targets b/src/Microsoft.Data.SqlClient/netfx/tools/targets/GenerateAssemblyInfo.targets index bdff0a0de6..f7f647cbe7 100644 --- a/src/Microsoft.Data.SqlClient/netfx/tools/targets/GenerateAssemblyInfo.targets +++ b/src/Microsoft.Data.SqlClient/netfx/tools/targets/GenerateAssemblyInfo.targets @@ -13,7 +13,7 @@ - + diff --git a/tools/targets/GenerateThisAssemblyCs.targets b/tools/targets/GenerateThisAssemblyCs.targets index 7382db4317..0bcdf8a2aa 100644 --- a/tools/targets/GenerateThisAssemblyCs.targets +++ b/tools/targets/GenerateThisAssemblyCs.targets @@ -8,7 +8,7 @@ BeforeTargets="CoreCompile"> -[assembly: System.CLSCompliantAttribute(true)] +[assembly: System.CLSCompliant(true)] namespace System { internal static class ThisAssembly From d803859c825d78924e8168de007fa0cfeaf65c9e Mon Sep 17 00:00:00 2001 From: Cheena Malhotra Date: Fri, 24 Jan 2020 10:32:31 -0800 Subject: [PATCH 3/3] Review feedback applied --- .../targets/GenerateAssemblyInfo.targets | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Microsoft.Data.SqlClient/netfx/tools/targets/GenerateAssemblyInfo.targets b/src/Microsoft.Data.SqlClient/netfx/tools/targets/GenerateAssemblyInfo.targets index f7f647cbe7..334b629788 100644 --- a/src/Microsoft.Data.SqlClient/netfx/tools/targets/GenerateAssemblyInfo.targets +++ b/src/Microsoft.Data.SqlClient/netfx/tools/targets/GenerateAssemblyInfo.targets @@ -13,19 +13,19 @@ - - - - - - - - - - - - - + + + + + + + + + + + + +