forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better handle resx scenarios (dotnet/corefx#38012)
* Better handle resx scenarios There were two resx scenarios that we weren't handling well. 1. BinaryFormatted data that is missing the type information BinaryFormatted data never takes the type into account, it's only used to check the deserialized data after it's read. In the old resx reader it would deserialize the data in the build task, only to reserialize it back, recording the type information. Since we're eliminating build time deserialziation we cannot do this, so just permit the payload to flow through without recording the type information. This is effectively what happened before since the user never recorded the type information in the resx so it isn't introducing any new opportunity for inconsistencies. To implement this I used the existing ResX format with a sentinel type to indicate that the BinaryFormatter payload type was unknown. 2. Primitive types stored as string ResX reader deserialized all types during the build, we're trying to eliminate this as it results in build time / cross-framework type loading. In doing so we lose the ability to handle primitive types since the only way we currently write primitive types is when they are passed in as live objects. To fix this, we'll make the string-based type converter method aware of primitive types, and permit it to deserialize those primitive types (IOW: parse the string via typeconverter) so that we still write these as primitive resources. We'll rename this method to AddResource to indicate it is more generic than just handling pre-serialized data. To identify primitive types we use a string comparer to match the type name written in the resx, and map it to a known type (in the build framework). * Respond to feedback * Apply suggestions from code review Co-Authored-By: Rainer Sigwald <[email protected]> Commit migrated from dotnet/corefx@00c7405
- Loading branch information
Showing
10 changed files
with
510 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.