Reproduction steps:
1. Open the attached “repro-project”
2. Build the project
Expected result: Build completed with a result of ‘Succeeded' or 'Failed’
Actual result: The Editor crashes
Reproducible with: 2022.1.0a15, 2022.1.23f1, 2022.2.0f1, 2023.1.0a20
Not reproducible with: 2020.3.42f1, 2021.3.14f1, 2022.1.0a14
Reproduced on: Windows 10 Pro
Note: When trying to build for a Standalone, Android, or Dedicated Server platform a Fatal Error pop-up appears
First few lines of the stack trace:
{{0x00007ff63d3d52c3 (Unity) CachedWriter::Write }}
{{0x00007ff63d77bf11 (Unity) StreamedBinaryWrite::TransferTypelessData }}
{{0x00007ff63d23e8cf (Unity) Texture2D::Transfer<StreamedBinaryWrite> }}
{{0x00007ff63d765c37 (Unity) SerializedFile::WriteObject }}
0x00007ff63d750069 (Unity) PersistentManager::WriteFile