I intend this to be the first in a series of blog posts that will help developers start working with and learning the MVC features in version 6.6 and later of the Sitecore ASP.NET web Content Management System (CMS). I based the information in this blog post on an internal build of Sitecore CMS 6.6, which I think should be very close to the beta available towards the end of June and the eventual version release. This blog post repeats some of the information available in the blog post Using Web Forms and MVC in a Single Solution with the Sitecore ASP.NET CMS and the comments on that post. For more information about using MVC with Sitecore, see the blog post Posts about Using MVC with the Sitecore ASP.NET CMS.
Install Sitecore by following the instructions in The Sitecore Installation Guide. I used the setup program and named my instance playground. One thing to beware: on the IIS Web Site page of the installer, click Advanced, and then select .NET Framework Version 4.0. You can use IIS Manager to update the framework version associated with the application pool. If you use the wrong version, you will likely receive the error "This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded".
After you install Sitecore, follow these steps to configure the new instance to support MVC:
To confirm MVC is working:
Layout = null;
if (Model == null)
I think that’s all it takes. If anyone follows this process, please comment about whether it worked for you.
Next in this series: Sitecore MVC Playground Part 2: Working without a (Visual Studio Dot) Net
What is internal build and how can we get it?
If you cannot access this: sdn.sitecore.net/.../6_6_0_rev_120622.aspx Then I think you need to http://sitecore.net/contact Sitecore in your region and ask about your SDN permissions.
Worked like a charm! :)
Hi John, I have just tested it on the cms 6.6 build 120981. It works fine. We need to change the steps to accommodate changes brought by the current release.
@Sen: I have to go through all of my old posts about MVC to see what has changed in the release, so I will investigate this as well. Do you have any specifics that you could post now and for me to consider later? When I ran the installer without MVC support, it didn't even install the files I would need for MVC, so you must have used the .zip (and from the sound of it, that defaults to no MVC support?) I already posted about the release installer enabling MVC by default, which obviates the need for these manual steps: www.sitecore.net/.../Sitecore-ASPNET-CMS-6-6-Installer-Enables-MVC-by-Default.aspx Thanks & regards, -John
Worked like a charm Thanks!
John, I did a presentation on MVC, has the document and PPT listing the steps. Please let me know, if we need to share it. :-)
@Sen: I would like to see that PPT! Can you email it to me or share it on an FTP server or something?
Worked great. Rgs
I've downloaded the latest drop - Sitecore.NET 6.6.0 (rev. 121203). It would appear that this process has changed with the latest release. Any insight as to how to configure for MVC now? I suspect it is even easier! Thanks,
Brian - the easiest way is definitely the installer, which enables MVC support by default. I don't know of anything that automatically creates Visual Studio projects for Web Forms, MVC, or both together in a single solution, so I would still create those manually.
This worked perfectly with 6.6.0, rev. 121203. Thanks for writing this up. Please note that the documentation at sdn.sitecore.net/.../MVC Reference.aspx does not mention all of the config.disable files that need to be renamed, and should be updated.
Also worked for me with 6.6.0, rev. 121203.
Hi John, thanks for this. The only thing is I found I typo (maybe just changed on Sitecore.NET 6.6.0 rev. 130111) , but you should use @Html.Sitecore().Placeholder("main") instead of "PlaceHolder" with capital h I was getting the error message "Sitecore.Mvc.Helpers.SitecoreHelper' does not contain a definition for 'PlaceHolder' . Cheers.
how about Sitecore 6.6.0 rev. 130111? it seems some steps has already been done.