Skip to content

Commit bc81ab8

Browse files
[Release 1.1] Make all assemblies CLS Compliant (dotnet#522)
1 parent a8ffd26 commit bc81ab8

File tree

5 files changed

+29
-15
lines changed

5 files changed

+29
-15
lines changed

src/Microsoft.Data.SqlClient/netcore/ref/Microsoft.Data.SqlClient.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5+
[assembly: System.CLSCompliant(true)]
56
namespace Microsoft.Data
67
{
78
/// <include file='..\..\..\..\doc\snippets\Microsoft.Data\OperationAbortedException.xml' path='docs/members[@name="OperationAbortedException"]/OperationAbortedException/*' />

src/Microsoft.Data.SqlClient/netfx/ref/Microsoft.Data.SqlClient.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
4-
4+
[assembly: System.CLSCompliant(true)]
55
namespace Microsoft.Data
66
{
77
/// <include file='..\..\..\..\doc\snippets\Microsoft.Data\OperationAbortedException.xml' path='docs/members[@name="OperationAbortedException"]/OperationAbortedException/*' />
8+
[System.Serializable]
89
public sealed partial class OperationAbortedException : System.SystemException
910
{
1011
internal OperationAbortedException() { }
12+
13+
private OperationAbortedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
14+
1115
}
1216
}
1317
namespace Microsoft.Data.Sql
@@ -27,6 +31,7 @@ public SqlNotificationRequest(string userData, string options, int timeout) { }
2731
public string UserData { get { throw null; } set { } }
2832
}
2933
}
34+
3035
namespace Microsoft.Data.SqlClient
3136
{
3237
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient/ApplicationIntent.xml' path='docs/members[@name="ApplicationIntent"]/ApplicationIntent/*'/>
@@ -1315,9 +1320,12 @@ public void CopyTo(Microsoft.Data.SqlClient.SqlError[] array, int index) { }
13151320
public System.Collections.IEnumerator GetEnumerator() { throw null; }
13161321
}
13171322
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient/SqlException.xml' path='docs/members[@name="SqlException"]/SqlException/*'/>
1323+
[System.Serializable]
13181324
public sealed partial class SqlException : System.Data.Common.DbException
13191325
{
13201326
internal SqlException() { }
1327+
private SqlException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
1328+
13211329
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient/SqlException.xml' path='docs/members[@name="SqlException"]/Class/*'/>
13221330
public byte Class { get { throw null; } }
13231331
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient/SqlException.xml' path='docs/members[@name="SqlException"]/ClientConnectionId/*'/>
@@ -1708,10 +1716,14 @@ public interface IBinarySerialize
17081716
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient.Server/IBinarySerialize.xml' path='docs/members[@name="IBinarySerialize"]/Write/*'/>
17091717
void Write(System.IO.BinaryWriter w);
17101718
}
1719+
17111720
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient.Server/InvalidUdtException.xml' path='docs/members[@name="InvalidUdtException"]/InvalidUdtException/*'/>
1721+
[System.Serializable]
17121722
public sealed partial class InvalidUdtException : System.SystemException
17131723
{
17141724
internal InvalidUdtException() { }
1725+
private InvalidUdtException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
1726+
17151727
}
17161728
/// <include file='../../../../doc/snippets/Microsoft.Data.SqlClient.Server/SqlDataRecord.xml' path='docs/members[@name="SqlDataRecord"]/SqlDataRecord/*'/>
17171729
public partial class SqlDataRecord : System.Data.IDataRecord

src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@
346346
<Version>4.3.0</Version>
347347
</PackageReference>
348348
<PackageReference Include="Microsoft.Data.SqlClient.SNI">
349-
<Version>[1.1.0,1.2.0)</Version>
349+
<Version>1.1.*</Version>
350350
</PackageReference>
351351
<PackageReference Include="Microsoft.Identity.Client">
352352
<Version>3.0.8</Version>

src/Microsoft.Data.SqlClient/netfx/tools/targets/GenerateAssemblyInfo.targets

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@
1313
<AssemblyInfo Include="using System.Runtime.InteropServices%3B" />
1414
<AssemblyInfo Include="using System.Runtime.Versioning%3B%0A" />
1515

16-
<AssemblyInfo Include="[assembly: System.CLSCompliantAttribute(true)]" />
17-
<AssemblyInfo Include="[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]" />
18-
<AssemblyInfo Include="[assembly: System.Runtime.Versioning.TargetFrameworkAttribute(&quot;.NETFramework,Version=$(TargetFrameworkVersion)&quot;)]" />
19-
<AssemblyInfo Include="[assembly: System.Resources.SatelliteContractVersion(&quot;$(AssemblyVersion)&quot;)]" />
20-
<AssemblyInfo Include="[assembly: System.Reflection.AssemblyTitleAttribute(&quot;$(AssemblyName)&quot;)]" />
21-
<AssemblyInfo Include="[assembly: System.Reflection.AssemblyDescriptionAttribute(&quot;$(Description)&quot;)]" />
22-
<AssemblyInfo Include="[assembly: System.Reflection.AssemblyCompanyAttribute(&quot;$(Company)&quot;)]" />
23-
<AssemblyInfo Include="[assembly: System.Reflection.AssemblyProductAttribute(&quot;$(Product)&quot;)]" />
24-
<AssemblyInfo Include="[assembly: System.Reflection.AssemblyCopyrightAttribute(&quot;$(Copyright)&quot;)]" />
25-
<AssemblyInfo Include="[assembly: System.Reflection.AssemblyVersionAttribute(&quot;$(AssemblyVersion)&quot;)]" />
26-
<AssemblyInfo Include="[assembly: System.Reflection.AssemblyFileVersionAttribute(&quot;$(AssemblyFileVersion)&quot;)]" />
27-
<AssemblyInfo Include="[assembly: System.Reflection.AssemblyInformationalVersionAttribute(&quot;$(Version)&quot;)]" />
28-
<AssemblyInfo Include="[assembly: System.Reflection.AssemblyConfigurationAttribute(&quot;$(Configuration)&quot;)]" />
16+
<AssemblyInfo Include="[assembly: CLSCompliant(true)]" />
17+
<AssemblyInfo Include="[assembly: ComVisible(false)]" />
18+
<AssemblyInfo Include="[assembly: TargetFramework(&quot;.NETFramework,Version=$(TargetFrameworkVersion)&quot;)]" />
19+
<AssemblyInfo Include="[assembly: SatelliteContractVersion(&quot;$(AssemblyVersion)&quot;)]" />
20+
<AssemblyInfo Include="[assembly: AssemblyTitle(&quot;$(AssemblyName)&quot;)]" />
21+
<AssemblyInfo Include="[assembly: AssemblyDescription(&quot;$(Description)&quot;)]" />
22+
<AssemblyInfo Include="[assembly: AssemblyCompany(&quot;$(Company)&quot;)]" />
23+
<AssemblyInfo Include="[assembly: AssemblyProduct(&quot;$(Product)&quot;)]" />
24+
<AssemblyInfo Include="[assembly: AssemblyCopyright(&quot;$(Copyright)&quot;)]" />
25+
<AssemblyInfo Include="[assembly: AssemblyVersion(&quot;$(AssemblyVersion)&quot;)]" />
26+
<AssemblyInfo Include="[assembly: AssemblyFileVersion(&quot;$(AssemblyFileVersion)&quot;)]" />
27+
<AssemblyInfo Include="[assembly: AssemblyInformationalVersion(&quot;$(Version)&quot;)]" />
28+
<AssemblyInfo Include="[assembly: AssemblyConfiguration(&quot;$(Configuration)&quot;)]" />
2929
</ItemGroup>
3030
<MakeDir Directories="$(IntermediateOutputPath)" />
3131
<WriteLinesToFile File="$(IntermediateOutputPath)$(AssemblyName).AssemblyInfo.cs" Overwrite="True" Lines="@(AssemblyInfo)" />

tools/targets/GenerateThisAssemblyCs.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
BeforeTargets="CoreCompile">
99
<PropertyGroup>
1010
<ThisAssemblyCsContents>
11+
[assembly: System.CLSCompliant(true)]
1112
namespace System
1213
{
1314
internal static class ThisAssembly

0 commit comments

Comments
 (0)