For me the issue came after an update of window 11, and was using VS2022. and by updating VS2022, it got fixed without any other tweaks