Error building CUDA project in Visual Studio

I am trying to use the CUDA toolkit through Visual Studio, but I am getting a build error. I ran the command that Visual Studio runs in a separate terminal in the same directory and I can see the errors in details is as follows `At line:1 char:73

  • … VIDIA GPU Computing Toolkit\CUDA\v12.2\bin\nvcc.exe" -gencode=arch=co …
  •                                                      ~~~~~~~~
    

Unexpected token ‘-gencode’ in expression or statement.
At line:1 char:97

  • … ng Toolkit\CUDA\v12.2\bin\nvcc.exe" -gencode=arch=compute_52,code="s …
  •                                                             ~
    

Missing argument in parameter list.
At line:1 char:1

  • "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin\nvcc.ex …

The assignment expression is not valid. The input to an assignment operator must be an object that is able to accept
assignments, such as a variable or a property.
+ CategoryInfo : ParserError: (:) , ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnexpectedToken
` I am running the CUDA toolkit, Visual Studio, and my graphics driver at their latest version. I even uninstalled and reinstalled the CUDA toolkit and Visual Studio implementation but it still didn’t work.