-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Support building System.DirectoryServices ref assembly against net5.0 #39401
Comments
Tagging subscribers to this area: @safern, @ViktorHofer |
I looked into this and basically the problem is that
If I go and add @ericstj is that desired? |
Technically you could fix this by adding a reference to netstandard.dll (facade) to DirectoryServices. That would let it unify the types. We don't currently build netstandard.dll early enough though, so @safern's suggestion is probably best if we want to do this. Another option would be to push down the types if we thought that would be cleaner. Question: why would we ship a nuget package in .NET 5.0 that obsoletes types exposed from the same package when targeting .NET5.0, but not when targeting .NETStandard. This creates a bit of a loophole. Is there a problem obsoleting everywhere the package exposes API? I guess the spec is relying on new members added to ObsoleteAttribute which are not present on .NETStandard which means we cannot use the new attribute members to obsolete API in packages that expose it in .NETStandard. |
When #35606 goes in, the netstandard shim is built early enough and can be referenced. Another option would be to P2P the shim. |
Correct that we would not be able to use the new properties. Additionally, features like CER and CAS are functional on .NET Framework, whereas they are not functional on .NET 5--the spirit of the obsoletions was to annotate features that are no longer functional in .NET 5, so I was only opting to apply the attributes where we know the feature isn't available. https://github.com/dotnet/designs/blob/master/accepted/2020/better-obsoletion/obsoletions-in-net5.md#other-considerations |
I have a hard time making myself comfortable with the idea that in a nuget package that supports multiple frameworks we make it more complicated to obsolete the types exposed by that package and we expend more effort in supporting those types in down level platforms. |
@ericstj If we do decide to apply the obsoletions to netstandard, would we still need to conditionally compile the ref assembly such that it uses the .NET 5.0 Meaning... would we still need net5.0-conditional compilation? |
EDIT: actually yes if we use different ObsoleAttribute form |
@jeffhandley what should we do with this issue? Asking as I don't see anything actionable on our (infrastructure) side. |
@ViktorHofer I think we have the following options:
Options 1 and 2 would still require building against net5.0, while option 3 would not. For option 3, if that is the recommended approach, I will need to determine which parts of our tooling do and do not support custom/internal |
If our tooling support option 3 I think that would be the best option from my perspective. However, if we can't do that, I think doing 2 is also fine. If we're going with 2 or 3, should we also do this for other OOB packages that had their APIs marked as Obsolete? |
I was finally able to confirm that this can work. Defining an internal I'll move forward with that approach in Thanks for the guidance! |
For dotnet/designs#139, I need to be able to mark 2 types in
System.DirectoryServices
as[Obsolete]
starting in .NET 5:DirectoryServicesPermission
andDirectoryServicesPermissionAttribute
.At present, the
src
project has the following:And the
ref
assembly has simply:I can conditionally add the attributes to the
src
project, but I cannot currently add the attributes to theref
assembly without also affectingnetstandard2.0
.I attempted to add
$(NetCoreAppCurrent)
into the target frameworks for the ref assembly but that produced the following build errors that I was unable to overcome:The
AccessRuleFactory
AuditRuleFactory
methods that are expressed as not being found seem to be available in netstandard2.0 as far as I could tell, and they're shown on the .NET API Catalog too. I can't figure out why they're not visible.The text was updated successfully, but these errors were encountered: