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

SqlConnectionStringBuilder does not report ICustomTypeDescriptor properties properly #1275

Closed
masonwheeler opened this issue Sep 22, 2021 · 12 comments

Comments

@masonwheeler
Copy link

Describe the bug

SqlConnectionStringBuilder inherits from a base class that implements ICustomTypeDescriptor, which is supposed to report the class's properties to a property inspector and make them easy to edit. Hooking one up to a SqlConnectionStringBuilder instance, however, shows several properties reported twice, where editing one of them works as expected and the other one raises data binding errors.

To reproduce

See attached project. Note that many properties are reported twice, including the all-important Data Source and Initial Catalog.

Expected behavior

Every connection string property should be reported exactly once and be editable without errors.

Further technical details

Microsoft.Data.SqlClient version: 4.8.3
.NET target: .NET 5
SQL Server version: n/a
Operating system: Windows 10

@JRahnama
Copy link
Member

@masonwheeler from the provided sample I can see System.Data.SqlClient is being used and the mentioned version also confirms that. Is that correct?

@JRahnama
Copy link
Member

How did you resolve SoftFluent.Windows to work for netcore? Can you test your project with Microsoft.Data.SqlClient latest preview release and see the results as well?

@masonwheeler
Copy link
Author

@masonwheeler from the provided sample I can see System.Data.SqlClient is being used and the mentioned version also confirms that. Is that correct?

Yes.

How did you resolve SoftFluent.Windows to work for netcore?

Not sure what you mean. I grabbed it from NuGet and built the project and ran it. Is it not building for you?

Can you test your project with Microsoft.Data.SqlClient latest preview release and see the results as well?

Thanks for the heads-up! I didn't even notice they were two different namespaces. With that package, it appears to be working as expected.

@JRahnama
Copy link
Member

image

The entire message is this:
Package 'SoftFluent.Windows 1.0.1.6' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework 'net5.0-windows7.0'. This package may not be fully compatible with your project.

System.Data.SqlClient is in servicing mode and is not accepting any updates, but critical ones. Microsoft.Data.SqlClient is getting updates on regular basis and this issue was resolved I believe in PR #1152

If the problem is solved please feel free to close the issue.

@masonwheeler
Copy link
Author

Yeah, that seems to be a nuisance warning that doesn't convey any useful information and can be safely ignored. All it means is that the last time the NuGet package was built was before .NET 5 was around.

Having said that, I get that message multiple times in my project for Microsoft.SqlServer.Types. Is there an up-to-date package anywhere that will provide the SQL Server types for a .NET 5 project?

@JRahnama
Copy link
Member

Not that I am aware of. What is the message? I am not getting that on my side on the provided sample.

@masonwheeler
Copy link
Author

It's not on the provided sample; it's on my actual project.

Warning NU1701 Package 'Microsoft.SqlServer.Types 14.0.1016.290' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework 'net5.0'. This package may not be fully compatible with your project.

@ErikEJ
Copy link
Contributor

ErikEJ commented Sep 23, 2021

There is no Microsoft.SqlServer.Types package for .NET 5.

@JRahnama
Copy link
Member

I did not have that package referenced in the provided sample code. I manually installed it and got the same message. Can you test removing that reference from you project?

@masonwheeler
Copy link
Author

@ErikEJ So who do I need to ping about getting it updated?

@masonwheeler
Copy link
Author

@JRahnama no; then it wouldn't compile because I'm using those types.

@cheenamalhotra
Copy link
Member

@masonwheeler

Microsoft.SqlServer.Types is not available for .NET 5 right now.
The team who owns it is aware and they are working on it as we know from internal discussions.

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

4 participants