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

Add NetCoreAppCurrent configuration to three ref projects #54146

Merged
merged 4 commits into from
Jun 15, 2021

Conversation

akoeplinger
Copy link
Member

System.ComponentModel.Composition, System.Diagnostics.PerformanceCounter and System.Runtime.Caching.

Helps with #54012

System.ComponentModel.Composition, System.Diagnostics.PerformanceCounter and System.Runtime.Caching.

Helps with dotnet#54012
@ghost
Copy link

ghost commented Jun 14, 2021

Tagging subscribers to this area: @Anipik, @safern, @ViktorHofer
See info in area-owners.md if you want to be subscribed.

Issue Details

System.ComponentModel.Composition, System.Diagnostics.PerformanceCounter and System.Runtime.Caching.

Helps with #54012

Author: akoeplinger
Assignees: -
Labels:

area-Infrastructure-libraries

Milestone: -


namespace System.Runtime.Caching.Configuration
{
#if NET5_0_OR_GREATER
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually don't ifdef and just set this property (in this case in the src csproj) to include the platform attributes on downstream tfms: <IncludePlatformAttributes>true</IncludePlatformAttributes>

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we already set that propery, but it's not enough here because browser is not recognized as a valid platform on these downstream tfms and the build would fail with:

error CA1418: The platform 'browser' is not a known platform name

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@buyaa-n is that expected?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it is, maybe we should disable the CA1418 for TFMs below 5.0

#if NET5_0_OR_GREATER
if (OperatingSystem.IsBrowser())
{
throw new PlatformNotSupportedException();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this method should have annotated with [UnsupportedOSPlatform("browser")] ?

Copy link
Member Author

@akoeplinger akoeplinger Jun 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, because you could implement your own custom version of IFileChangeNotificationSystem that works on browser and pass it in via ObjectCache.Host. We should only throw when we're using the default implementation.

@akoeplinger akoeplinger merged commit 9414d57 into dotnet:main Jun 15, 2021
@akoeplinger akoeplinger deleted the add-netcoreappcurrent branch June 15, 2021 09:46
@ghost ghost locked as resolved and limited conversation to collaborators Jul 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants