Hi @Santhi Dhanuskodi @Qing Guo - MSFT
I realize this response is quite delayed, but I encountered the same issue today and found a solution:
Make sure the NuGet package Microsoft.VisualStudio.Web.CodeGeneration.Design matches the .NET Core version used in your application. If it's missing, install the package and rebuild your project.
After completing the above steps, try adding the controller again—this time, it should work like a charm!