68197

How to setup Umbraco 6.1.2 in Visual Studio 2012 with MVC enabled to use in TFS? [closed]

Question:

What I want is a development environment in Visual Studio 2012 for Umbraco version 6.1.2 (latest stable version at the moment) with MVC as rendering engine so I can use Razor and integrate a MVC project in Umbraco.

I also want to be able to use a Team Foundation Sever to share and store the code.

The problem lies here: When I just download the Umbraco files from Umbraco or use WebMatrix to install an Umbraco site, I do not have access to the core files or a way to properly debug my install in Visual Studio.

So I need a way to build and debug/run Umbraco from Visual Studio.

I looked at a lot of posts, articles etc. (also on StackOverflow) but none seemed to address the latest Umbraco version (most about 4.5.x) and only a few about MVC. Old references, non existing project templates or templates to old versions of VS made me have to dig further. When I then found a solution, I thought about 2 things: - 1 I need to check this solution - 2 I should share this solution to a wider audience then it is getting now

Both two reasons are what made me post it here (clarification as asked)

Answer1:

Actually, all you need to do is create an empty MVC4 project and add the Umbraco NuGet package, as this will also add the Core binaries package and set the dependencies for you.

Answer2:

I found <a href="http://www.ben-morris.com/using-umbraco-6-to-create-an-asp-net-mvc-4-web-applicatio" rel="nofollow">http://www.ben-morris.com/using-umbraco-6-to-create-an-asp-net-mvc-4-web-applicatio</a>, which is the lastest article about the subject I could find (the download link in the article is to the old repository and not the current download page of Umbraco, though).

This setup worked really well for me (Umbraco version 6.1.2)

<ol><li>Firstly, start an empty MVC 4 project in Visual Studio – make sure it is an empty project as you will not need any of the baggage that comes with other project templates. </li> <li>Add the NuGet Umbraco Cms Core Binaries package which will manage the various dependencies and references that Umbraco 6 requires for you. </li> <li>Copy all the files from the <a href="http://our.umbraco.org/download" rel="nofollow">Umbraco installation ZIP archive</a> 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.</li> </ol>

If you want Umbraco to play nice to MVC and be able to use Razor views, you should change the default rendering engine to MVC in Config\UmbracoSettings.config like so:

<templates> <useAspNetMasterPages>true</useAspNetMasterPages> <defaultRenderingEngine>Mvc</defaultRenderingEngine> </templates>

Answer3:

One problem you will have is ensuring all necessary files are checked in when modifying your umbraco site locally.

For example if you add a media image using the umbraco backend. Visual studio won't automatically add it to the project and therefore source control for you so a check in will miss it. You have to include the files in the project manually which can become tricky when big changes are made.

I'd like to know if anyone else has a better way of managing it.

Recommend

  • Image manipulation with javascript
  • Use WPF Controls in Web project
  • Redirect SQL Server's events from std Application log into a custom one
  • @UIScope annotation not respected for spring view?
  • Using the Events in a serial port component TComPort (v4) from a thread in Delphi?
  • How can I tell which Javascript module created an element/table on a webpage?
  • Horizontal Bar extending outer container
  • Adding new user Tab in the Doxygen Layout
  • Webpage with wide iframe is not scrollable on an iPhone with viewport
  • How to increase the size of JScrollPane pane?
  • javascript XSLT nodes, selecting the first of a group (merge-like)
  • Botframework - resize bot chat in width [duplicate]
  • How to record a JNLP/ Java Web Start application with JMeter
  • Dispose not working as expected in DirectorySearcher
  • Fluid video height
  • Weird LEFT OUTER JOIN on Includes eager loading of rails 3
  • How to make nicEditor snaplet? (Several questions)
  • Retaining data after updating application
  • apply a javascript function to draggable copy
  • How to handle elastic beanstalk deployment so it uploads only changed files
  • How can I tell a form not to dispose a particular control when it closes?
  • Hash Code in SQL Server?
  • jwtBearer bearer token with rc-1 update to ASP.Net 5
  • Filter strings with regex before casting to numeric
  • Android changing fragment order inside FragmentPagerAdapter
  • Intel-64 and ia32 atomic operations acquire-release semantics and GCC 5+
  • Read text file that is not in the main package in a runnable jar
  • Create DicomImage from scratch using Dcmtk
  • Groovy: Unexpected token “:”
  • How to define custom class, title, and target in Link Browser for content elements and the new rte_c
  • Webgrid not refreshing after delete MVC
  • How to clear text inside text field when radio button is select
  • How to avoid particles glitching together in an elastic particle collision simulator?
  • Recording logins for password protected directories
  • Splitting given String into two variables - php
  • Excel - Autoshape get it's name from cell (value)
  • Check if a string to interpolate provides expected placeholders
  • RestKit - RKRequestDelegate does not exist
  • Unanticipated behavior
  • Traverse Array and Display in markup