It is amazing to see how many people have posted questions revolving around this same issue.
I have read most of them on here and on Apple's developer forum, and I have downloaded, installed, deleted, trusted, etc. all sorts of Apple Worldwide Developer certificates countless times, but nothing works.
I am using Visual Studio 2022 Pro on Windows 10 and connecting to a Mac Ventura 13.2 that has XCode 14.2. It bears mentioning that everything was working for Xamarin Forms development, but VS 2022 would not connect to my Mac when working in a MAUI project, so before Microsoft fixed VS 2022, I tried rebuilding my Mac from scratch, and I haven't been able to get it working again.
As of right now, besides our distribution certificates (iPhone Distribution for for internal AdHoc needs and Apple Distribution for the App Store), my keychain has:
AppleRootCA-G3.cer - Apple Root CA - G3 (Expires Apr 30, 2039)
AppleWWDRCAG3.cer - Apple Worlwide Developer Relations Certificate Authority (Expires Feb 19, 2030)
Attempting to build with either of our certificate/provisioning profile sets gets the "unable to build chain" error. I'm not an Apple expert, by far, but I think that means there is a missing link in the chain, but far be it from me to know just what that is.
I finally found the article, "Fixing an untrusted code signing certificate" by Quinn “The Eskimo!” @ Developer Technical Support @ Apple:
https://developer.apple.com/forums/thread/712043
Somewhere along the line in all of my attempts to resolve this issue, I had set the trust factor on our certificates to "Always Trust," but Quinn says, "customising trust settings might cause problems...Ensure that all the popups are set to their default values (Use System Defaults for the first, “no value specified” for the rest)."
Changing the trust settings to System Defaults made everything work!