Repository navigation
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.
| <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.
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.
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)