Orchard is MVC 3, right?

Topics: Customizing Orchard
Jul 4, 2011 at 10:32 AM

I have the latest MVC3 Tools Update for VS2010...and everything works in other project solutions...but not in my Orchard Enlistment (1.2).

When I right click a Controllers folder in any module, the 'Add' menu has no 'Controller' selection...I can't get to the Add Controller dialog.

I would love to have scaffolding in orchard for my new modules.

Any suggestions?

Jul 4, 2011 at 11:38 AM

This has been discussed previously, but the main thing is that your module's .csproj is missing a guid that tells VS: "This is an MVC3 project".

That guid is

{E53F8FEA-EAE0-44A6-8774-FFD645390401};

In your solution, right click on the module's project, Unload Project. Then right click again and Edit Module.csproj.

Replace, or add the guid I gave you previously like so:

    <ProjectTypeGuids>{E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>

Reload and you should be able to Add Controller.. Razor Views etc.
Jul 4, 2011 at 12:50 PM

Wonderful! Thanks.

I did spend hours trying to find a previous discussion on this...even searched the web...how did I miss it? How would you tag this?

Thanks, again!

Jul 4, 2011 at 1:24 PM

The important thing is to use it a couple of times. The intent was to be able to use a standard web template, so that WebMatrix users can work on projects as well.

I don't know if it has any relevance that they add or don't add that ProjectTypeGuid, by default they don't so I do it in order to get ASP.NET MVC3 project type working.

Coordinator
Aug 23, 2011 at 4:30 PM

we didn't do it because we were eraly adopters of MVC3, and if someone would have opened the solution in VS, then the project could not load. By the way it's still relevant. Tough decision to make.

Mar 13, 2012 at 1:30 AM

I can see why the Orchard projects don't include the tooling Guids and why the generated module code wouldn't include the Guids, but I'm seeing build errors because I have chosen to add the Guids myself. I checked and saw that these errors have specifically been added to the Orchard build - why is that? If I don't want them I can leave them out, if I do want them I can put them in, I'm not sure why the build should care about them though?