I faced the same issue with 5.3.2 and VS 17.8.4.
Steps I took to fix it:
- updated VS to the latest version
- verified the unreal engine installation
- cleaned up the generated project files
- rebuild the solution from the context menu option
- Rebuild the solution in rider
- started the editor from rider
After these steps I can package my game again.
Edit:
I did not had to fix any engine files or something