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

Missing CLSCompliant(true) attribute on ref assemblies #476

Closed
KristianWedberg opened this issue Mar 20, 2020 · 2 comments
Closed

Missing CLSCompliant(true) attribute on ref assemblies #476

KristianWedberg opened this issue Mar 20, 2020 · 2 comments

Comments

@KristianWedberg
Copy link

Describe the bug

The ref/net46/Microsoft.Data.SqlClient.dll assembly in the Microsoft.Data.SqlClient package (both 1.1.1 and 2.0.0-preview1.20021.1) is missing the [assembly: CLSCompliant(true)] attribute, even though assemblies in the lib/net46 and runtimes/win/lib/net46 folders do have the attribute.

This leads to CS3001 and CS3003 (not CLS-compliant) build warnings when using e.g. SqlBulkCopyOptions in a public API in a CLS compliant assembly targeting .NET 4.6.1:

In contrast, the System.Data.SqlClient package does not have this issue (i.e.
the ref/net46/Microsoft.Data.SqlClient.dll assembly does have the attribute).

To reproduce

Reference SqlBulkCopyOptions in a public API in a CLS compliant assembly targeting .NET 4.6.1:

AssemblyInfo.cs:

[assembly: CLSCompliant(true)]

Program.cs:

using Microsoft.Data.SqlClient;

public class MyClass
{
        public SqlBulkCopyOptions SqlBulkCopyOptions { get; set; }
}

This gives a build warning:

Warning	CS3003	Type of 'MyClass.SqlBulkCopyOptions' is not CLS-compliant

Expected behavior

No CLS related build warnings.

Further technical details

Microsoft.Data.SqlClient version: 1.1.1 and 2.0.0-preview1.20021.1
.NET target: .NET Framework 4.6.1
Operating system: Windows 10

@cheenamalhotra
Copy link
Member

Hi @KristianWedberg

We have addressed this issue in PR #396.
It is going to be part of our next preview release!

@KristianWedberg
Copy link
Author

Ahh, I searched issues only, and missed that one - thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants