Sqlclient: SqlFacet missing?

Created on 20 Aug 2020  路  7Comments  路  Source: dotnet/SqlClient

I'm looking for the SqlFacet class. It appears to be in the old System.Data.SqlClient package for the full .Net framework and in .Net Core but was not available when referencing System.Data.SqlClient from a Net Standard library.

Similarly, it appears SqlFacet is missing from this repository.

Can someone explain why it has not been accessible from Net Standard when referencing System.Data.SqlClient and why it is not in this repository now?

Is there a plan to add SqlFacet to this repository and to make it accessible when referencing Microsoft.Data.SqlClient from a Net Standard library?

Thanks!

Enhancement

All 7 comments

Hi @agilenut

From initial research, I think we should be able to support it, it's probably missed out here.
We will acknowledge this as an enhancement and plan to support it soon.

I'm not sure why it was not available in .NET Standard for S.D.S, but will look more into it and update again.

Hi @cheenamalhotra. Thanks for marking that as an enhancement. I'll keep an eye on this.

For now, we will likely multi-target netstandard2.0 and net48 and will include a definition of the attribute class in our project wrapped in #if / #endif to get netstandard to compile.

The missing attribute is also mentioned here, way back in 2017, where it is one of many missing things flagged as "TypesMustExist".
https://github.com/dotnet/SqlClient/issues/17

Conjecture. SqlFacet is used in SQLCLR and the netcore version of this library can't be used in SQLCLR so it was removed in porting netfx to netcore. Because netstandard was union of netcore and netfx it being missing in netcore probably caused it to be omitted from netstandard. While the type can be added it won't have any use in this library as far as I know. What are you intending to do with it?

@Wraith2

We have a library of lookup types that act similar to enums which need to be available to SQLCLR as well as logic in various nuget libraries and other business logic. Having the attribute in netstandard would allow us to target our types library to netstandard, thus allowing the other libraries and business logic that references it to be in netstandard. The actual attribute will not be used in netstandard but having it available allows us to multi-target both uses cases (4.8 for SQLCLR and netstandard for our calling libraries).

The type won't be added to netstandard, there will be no further versions of netstandard now that .net5 and later are unifying the bcl for netcore and mono. It's trivial to add it to this library's netstandard build but it'll never be usable. If that is enough then I'm fine with adding it I just want you to be aware it's not going to be usable for anything but satisfying type presence, which sounds like it might be all you need.

@Wraith2 - Yes, that is all that I need. And, yes, I'm not expecting the type to become a part of the netstandard definition. I just need it in a package that targets netstandard2.0 so that I can reference it from a netstandard2.0 project.

Was this page helpful?
0 / 5 - 0 ratings