Controller is Missing from “Add New Item” Dialog in Visual Studio 2012

We upgraded an ASP.NET 4.0 WebForms application to use MVC4 – but the “Add New Item” dialog didn’t list Controller in the list of web file types.

After a bit of research and using a file compare tool, I found this is controlled by the “ProjectGuidTypes” setting in the .csproj file.

An MVC web project will have the {E3E379DF-F4C6-4180-9B81-6769533ABE47} type in this setting. If your project isn’t showing this option, try adding this to the setting, e.g. :

<ProjectTypeGuids>{E3E379DF-F4C6-4180-9B81-6769533ABE47};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s