How to solve "CMake Error: Error: generator : Visual Studio 17 2022"

Launching lib\main.dart on Windows in debug mode...
CMake Error: Error: generator : Visual Studio 17 2022
Does not match the generator used previously: Ninja
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.
Building Windows application...
Exception: Unable to generate build files

The answer is fairly simple, but took me ome time to resolve when building hailort on Windows. there are multiple CMakeCache.txt in the build directory :disguised_face:

simple find them all and remove it. The source of the issue stems from trying to build the project from two different environments, in my case visual-studio and vs-code.