Click here to Skip to main content
11,934,809 members (49,317 online)
Click here to Skip to main content
Add your own
alternative version


6 bookmarked

Create Your First MVC Project in Umbraco (ver 6)

, 15 Jun 2013 CPOL
Rate this:
Please Sign up or sign in to vote.
How to create your first MVC project in Umbraco


Here, I am going to create a new blank MVC4 project in Microsoft Visual Studio 2010 and then I will add Umbraco 6.0.3 package to it. In this process, unfortunately, you may encounter a couple of bugs which have been highlighted in yellow.


Umbraco is an open source ASP.NET CMS. More information regarding it can be found here.

Using the Code

  • Create an empty MVC 4 project in Visual Studio.
  • Add the NuGet Umbraco Cms Core Binaries package to manage various dependencies and references that Umbraco 6 requires. To do this, open Package Manager Console (From the Tools menu, select Library Package Manager and then click Package Manager Console) and type Install-Package UmbracoCms.Core -Version 6.0.3.

  • Download and copy all the files from the Umbraco installation ZIP archive directly into your project in Visual Studio except the App_Code and Bin folders – you won’t need the binaries as they are managed by NuGet and the App_Code folder is not used in a web application project.
  • Change the default mode for Umbraco from web forms to MVC in the defaultRenderingEngine setting in the Umbraco configuration file UmbracoSettings.config as shown below:

Unfortunately, if you run the application now, you may encounter the error ApplicationException: The current httpContext can only be set once during a request.

The solution is to do the following in the web.config file.

Copy the httpModules tag and keep it handy for later use.

Add <add name="umbracoRequestModule" type="umbraco.presentation.requestModule" />
Add <add name="umbracoBaseRequestModule" type="umbraco.presentation.umbracobase.requestModule" />
Comment out <!--<add name=" UmbracoModule" type="Umbraco.Web.UmbracoModule,umbraco" />--> 
<add name="UrlRewriteModule" type="UrlRewritingNet.Web.UrlRewriteModule, 
UrlRewritingNet.UrlRewriter" />
<add name="umbracoRequestModule" type="umbraco.presentation.requestModule" />
<!-- UMBRACO --> 
<!--<add name=" UmbracoModule" type="Umbraco.Web.UmbracoModule,umbraco" />-->
<add name="umbracoBaseRequestModule" type="umbraco.presentation.umbracobase.requestModule" />
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, 
System.Web.Extensions, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="ClientDependencyModule" type="ClientDependency.Core.Module.ClientDependencyModule, 
ClientDependency.Core" />

Now the application will debug successfully and the Umbraco installation wizard will start to configure Admin and DataBase details.

The five steps of the wizard are displayed below:

Points of Interest

The following articles were consulted to compose this blog. For more details of any particular domain, click on the appropriate link below:


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer
India India
No Biography provided

You may also be interested in...

Comments and Discussions

QuestionIs it free Pin
sachinthamke21-Jan-14 6:09
membersachinthamke21-Jan-14 6:09 
AnswerRe: Is it free Pin
piyush_singh21-Jan-14 21:10
memberpiyush_singh21-Jan-14 21:10 
GeneralFirst time worked on Umbraco CMS Pin
Juhi Paunikar2-Jul-13 1:57
memberJuhi Paunikar2-Jul-13 1:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.151126.1 | Last Updated 15 Jun 2013
Article Copyright 2013 by piyush_singh
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid