Solution for : Cannot Create WEB-API controller in converted MVC4 Project

When you right click on your controller folder > create controller , then MVC4 WEB-API controller option should be available. If not do following to fix it.

  • In Solution Explorer, right-click the project name and then select Unload Project. Then right-click the name again and select Edit ProjectName.csproj.
  • Locate the ProjectTypeGuids element and replace {E53F8FEA-EAE0-44A6-8774-FFD645390401} with {E3E379DF-F4C6-4180-9B81-6769533ABE47}.
  • Save the changes, close the project (.csproj) file you were editing, right-click the project, and then select Reload Project.
This is applicable to the projects converted from MVC3 to MVC4


Popular posts from this blog

Embedding PowerBI with ASP.NET Core 2 and Angular(2,4,5)

Handling Exit Event of Console Application in C#

CSS text-overflow ellipsis in the beginning of the the text - Left Ellipsis using CSS in a Flex box