Commit e8be7f2
Bugfix: System.Xml.Serialization: Compiler.GetTempAssemblyName is not deterministic under .NET Core (#46499)
* Bugfix: System.Xml.Serialization: Compiler.GetTempAssemblyName is not persistent under .NET Core
The implementation of String.GetHashCode() was persistent by default in .NET Framework. allowing to predictably name an XmlSerializers.{HashCode}.dll containing the pre-generated serializers.
In .NET Core / .NET 5, String.GetHashCode() is no longer persistent, so the value of ns.GetHashCode() will change during each run, preventing it from picking up the XmlSerializers dll correctly.
* Remove trailing whitespace
* Use truncated SHA512
* Fixed compilation
* Dispose SHA512 instance
* Fixed compilation
* Update src/libraries/System.Private.Xml/src/System/Xml/Serialization/Compiler.cs
Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Update src/libraries/System.Private.Xml/src/System/Xml/Serialization/Compiler.cs
Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Update Compiler.cs
Co-authored-by: Stephen Toub <stoub@microsoft.com>1 parent 7eb749c commit e8be7f2
2 files changed
Lines changed: 15 additions & 4 deletions
File tree
- src/libraries/System.Private.Xml/src
- System/Xml/Serialization
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
567 | 567 | | |
568 | 568 | | |
569 | 569 | | |
| 570 | + | |
570 | 571 | | |
571 | 572 | | |
572 | 573 | | |
| |||
Lines changed: 14 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
| 7 | + | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | | - | |
| 12 | + | |
| 13 | + | |
11 | 14 | | |
12 | 15 | | |
13 | 16 | | |
| |||
89 | 92 | | |
90 | 93 | | |
91 | 94 | | |
92 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
93 | 103 | | |
94 | 104 | | |
95 | 105 | | |
0 commit comments