Unable to add a new Controller in Visual Studio
I am trying to learn .NET. I created a new C# MVC project but I'm unable to add a new controller. I don't see any option for that.
I asked Copilot and googled it but unlike they say, there is no "Controller" button under "Add"
I'm using the Visual Studio Community Edition downloaded from the Microsoft Store
17 Replies
Add new item
There you should have all the different scaffolding options
I tried that but I can't find controller on there
Where should I be looking here?
Web
but still no controller option
Huh
I'd just not bother and add write the controller myself tbh ¯\_(ツ)_/¯
Just to double-check though
1. Do you have the web worload installed with VS?
2. What's the version of .NET this project uses?
what's web worload?
I opened .csproj in notepad and it has
When you run the Visual Studio Installer you can modify your VS installation
VS isnt in project mode
That's where you can install different workloads
its in folder mode
Ah
The classic
with VS, you need to open a solution or project file, not a folder
So, yeah, close VS and open it by double-clicking the
.sln
file of your project
Or .csproj
should the sln not be there