-
Couldn't load subscription status.
- Fork 1.2k
Use preserialized resources to target Core 3 #3342
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
Use preserialized resources to target Core 3 #3342
Conversation
Opts into the new System.Resources.Extensions approach to resource serialization when targeting .NET Core 3.0+/.NET Standard 2.1+. Respects project setting if the project explicitly sets the property, to allow opting .NET Framework-targeting applications to opt in.
src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets
Outdated
Show resolved
Hide resolved
| <GenerateResourceUsePreserializedResources | ||
| Condition="'$(GenerateResourceUsePreserializedResources)' == '' and | ||
| ( ('$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(_TargetFrameworkVersionWithoutV)' >= '3.0') or | ||
| ('$(TargetFrameworkIdentifier)' == '.NETStandard' and '$(_TargetFrameworkVersionWithoutV)' >= '2.1') )">true</GenerateResourceUsePreserializedResources> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
System.Resources.Extensions is not part of .NETStandard2.1 and the package itself works on .NETStandard2.0. What's the reasoning for tying this to 2.1? Will it still check for the presence of S.R.E in references?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Misunderstanding: I thought it was part of standard2.1. Restricting to the known-good .NET Core 3.0+ case.
|
So if I want to enable this on another framework I need to reference the |
|
That's the current state. Do we have a better idea of what's "right"? |
|
I think that's fine, just wanted to clarify. I agree that we need more than just the reference, because the package might be a transitive dependency. So I am fine with both the flag and the reference, so long as we check that the reference is present when the flag is set, so that we don't get unexpected run-time issues. |
…build 20191028.1 (dotnet#3342) - Microsoft.NET.Sdk.Razor - 3.1.0-preview2.19528.1
Opts into the new System.Resources.Extensions approach to resource
serialization when targeting .NET Core 3.0+/.NET Standard 2.1+.
Respects project setting if the project explicitly sets the property, to
allow opting .NET Framework-targeting applications to opt in.
This is my stake-in-the ground proposal: light this up automatically for the folks who definitely need it. Happy to have discussion about other times when we should set this.
Important factors include:
@nguerrera @livarcocc @ericstj @merriemcgaw @dreddy-work
(this property does nothing but is harmless until it runs in conjunction with dotnet/msbuild#4420; posting this now to review in parallel)