2

I have an ASP.NET WebForms application that I'm adding some ASP.NET MVC to.

I have it working, but how can I get Visual Studio to recognise that it's now an MVC project and give me the context menu options to add a view, etc. inside a controller action method?

3 Answers 3

6

Open the .csproj file with your favorite text editor (not Visual Studio) and add the following GUID:

<ProjectTypeGuids>{F85E285D-A4E0-4152-9332-AB1D724D3325};{fae04ec0-301f-11d3-bf4b-00c04f79efbc};{349c5851-65df-11da-9384-00065b846f21}</ProjectTypeGuids>

Notice the {F85E285D-A4E0-4152-9332-AB1D724D3325} GUID. This is what indicates that it is an ASP.NET MVC project.

Once this GUID added to the ProjectTypeGuids node you will get the context menus.

Sign up to request clarification or add additional context in comments.

3 Comments

Hmmm interesting. That GUID is already in there, but VS doesn't give me the menu options. I have shutdown and restarted VS.
OK, I compared the .csproj file with an MVC .csproj file, and it appears that the required GUID is: {F85E285D-A4E0-4152-9332-AB1D724D3325} - this now works.
Oops, you are totally correct. I copy-pasted the wrong one :-). I've updated my answer. Thanks for pointing this out.
1

I don't know the specifics, but the easiest way is to create a new MVC project, and then use BeyondCompare (or your comparison tool of choice) on the two project files and see what is missing from your project. Then move those lines over and it should work.

The project file is just an XML file behind the scenes, so doing a text compare is relatively easy.

Comments

0

In VS11 you have to enter this GUID into the ProjectTypeGuids:
{E53F8FEA-EAE0-44A6-8774-FFD645390401}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.