No Controllers menu item on the Asp.net core 5.0 Web API project

Microsoft Visual Studio Community 2019 Version 16.9.4 Windows 10 Pro

Any clue why I cannot see the Controllers menu item? This is the Asp.net core 5.0 Web API project

MS Doc says this:

But I cannot see that?

enter image description here

New items has this:

enter image description here

Update

CinamaApi.csproj

<Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>net5.0</TargetFramework> </PropertyGroup> <ItemGroup> <PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" /> </ItemGroup> <ItemGroup> <Folder Include="Controllers\" /> </ItemGroup> </Project> 

enter image description here

2

1 Answer

OP's feedback

Need to install ASP.NET workload when install/update the VS

Ref:

Original

Based on the icon of your project, your project is not an API.

Go to your .csproj file and edit the first line into

<Project Sdk="Microsoft.NET.Sdk.Web"> 

Then you will scaffold item in your context menu

After a reload your project icon should become like this:

7

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like