Try these solutions and forums out. I've been having the EXACT same issues and these seemed to have helped:
- Windows 11 Pro 23H2 won't do an inplace upgrade says 0x8007042B - - Microsoft Community
- This link serves as a part 2 to the link above. This link has the solution that I've tested in a VM with the same issues and it was successful in reinstalling the Microsoft Store and other store/Windows related apps that also weren't working.
- How to Reinstall Microsoft Store in Windows
- Can I Reinstall Microsoft Store on My Windows? - MiniTool
- How to Download Microsoft Store App in Windows 10/11 - MiniTool
(Try these as a last option, if the links above don't help. The website these provide is safe according to VirusTotal) - If all else fails and you've already tried other stuff on the internet, I would recommend going the reinstalling windows route.
TRY THE Keep my personal files and apps OPTION FIRST.
THEN if that doesn't work, try the Keep personal files only option. (This is the one I went with because I have a lot of corrupted packages)
PLEASE READ CAREFULLY BEFORE YOU DO THIS OPTION:
The Keep personal files only option WILL DELETE data in your Program Files folder, Program Files(x86) folder, ProgramData folder, Windows folder, YOUR GLOBAL AND USER ENVIRONMENT VARIABLES, and your AppData/local low and AppData/roaming folders. It will NOT DELETE any folder or file located in the ROOT DIRECTORY of your C Drive (C:~) that YOU HAVE CREATED OR MOVED THERE, as long as it's NOT WINDOWS RELATED!! It will NOT DELETE anything on your other drives. It will NOT DELETE anything in the /User directory. EXCEPT FOR your AppData/local low and AppData/roaming folders.**** I HIGHLY RECOMMEND TO CLONE YOUR (C:) DRIVE FIRST TO BACK IT UP!!! (THAT WAY YOU DON'T HAVE TO WORRY ABOUT LOSING YOUR DATA) ****ALSO SAVE A LIST OF ANY ENVIRONMENT VARIABLES YOU OR A PROGRAM HAVE SET THAT YOU WANT TO KEEP. THAT WAY YOU CAN MANUALLY ADD THEM BACK LATER!!! **** This can be done with Samsung Magician, Macrium Reflect, or similar 3rd party tools. **** YOU WILL REQUIRE A SEPARATE STORAGE DRIVE TO DO THIS.
Windows 11 has a ton of bugs and poorly constructed features; Microsoft has their work cut out for them, so I really hope they're working rigorously on improving their software and dishing out fixes for all these critical issues.
Let me know if these end up working for you and mark this as a solution if it does! I really hope this helps you.