This repository was archived by the owner on Jun 5, 2025. It is now read-only.
Merged
Conversation
Contributor
|
LGTM. Consider adding unit test for the generated vs expected JSON to ensure this does not regress in the future. |
AmelBawa-msft
approved these changes
Aug 9, 2024
Contributor
Author
As I understand, this was technically not a regression. The .Net7 breaking change just made it necessary to explicitly declare the TypeInfoResolver property. There is no change in the JSON. |
ssparach
approved these changes
Aug 10, 2024
krschau
approved these changes
Aug 12, 2024
3 tasks
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the pull request
Fixes an issue with JsonSerializerOptions caused by this breaking change in .Net8 that is mysteriously not hitting on Dev builds (not just my computer).
References and relevant issues
microsoft/devhome#3573
Detailed description of the pull request / Additional comments
.Net8 requires explicit declaration of TypeInfoResolver in JsonSerializerOptions for complex objects. The failure stack in Canary build was:
*** WARNING: Unable to verify checksum for C:\Program Files\WindowsApps\Microsoft.Windows.DevHomeGitHubExtension.Canary_0.1700.585.0_x64__8wekyb3d8bbwe\System.Text.Json.dll
Child-SP RetAddr Call Site
00 000000c1
197bdfd0 00007ffee916b423 KERNELBASE!RaiseException+0x6c01 000000c1
197be0b0 00007ffee916adc9 coreclr!RaiseTheExceptionInternalOnly+0x26b [D:\a_work\1\s\src\coreclr\vm\excep.cpp @ 2795]02 000000c1
197be1c0 00007ffe89695558 coreclr!IL_Throw+0xb9 [D:\a_work\1\s\src\coreclr\vm\jithelpers.cpp @ 4247]03 000000c1
197be320 00007ffedb1c1e96 System_Text_Json!System.Text.Json.ThrowHelper.ThrowInvalidOperationException_JsonSerializerIsReflectionDisabled()+0x4804 000000c1
197be360 00007ffedb1c102c System_Text_Json!System.Text.Json.JsonSerializerOptions.ConfigureForJsonSerializer()+0x3605 000000c1
197be390 00007ffedba1fae1 System_Text_Json!System.Text.Json.JsonSerializer.GetTypeInfo(System.Text.Json.JsonSerializerOptions, System.Type)+0x2c06 000000c1
197be3d0 00007ffedba1ff7b System_Text_Json!System.Text.Json.JsonSerializer.GetTypeInfo[System.__Canon, System.Private.CoreLib]+0x3107 000000c1
197be420 00007ffedb9f9c20 System_Text_Json!System.Text.Json.JsonSerializer.Serialize[[System.__Canon, System.Private.CoreLib]](System.__Canon, System.Text.Json.JsonSerializerOptions)+0x2b08 000000c1
197be460 00007ffeda92fcd0 GitHubExtension!GitHubExtension.Helpers.Json.Stringify[System.__Canon, System.Private.CoreLib]+0x3009 000000c1
197be4a0 00007ffedaa3bedc GitHubExtension!GitHubExtension.DeveloperId.LoginUIPage.UpdateExtensionAdaptiveCard(Microsoft.Windows.DevHome.SDK.IExtensionAdaptiveCard)+0x300a 000000c1
197be4f0 00007ff819f77503 Microsoft_Windows_DevHome_SDK_Lib!ABI.Microsoft.Windows.DevHome.SDK.IExtensionAdaptiveCardSession.Do_Abi_Initialize_0(IntPtr, IntPtr, IntPtr*)+0x6cFixed using the recommended way in breaking change
Validation steps performed
Ran tests, automated and manually. Couldn't repro original bug on Dev build, but this doesn't break anything on Dev build.
PR checklist