Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Gordon Saxby 1444 posts 1855 karma points
    Feb 18, 2011 @ 13:07
    Gordon Saxby
    1

    Umbraco 4.6.1 and MVC 3

    I am involved in a new project where the client wants to use Umbraco 4.6.1 and MVC 3 together.
    At the moment all I am trying to do is make a standard install of Umbraco 4.6.1 work with a basic MVC app. I am using IIS7 / Integrated Mode / Windows 7 and Visual Studio 2010.
     
     
     
    but whatever I do I get "The resource cannot be found" - trying to access the MVC content. The standard Umbraco pages work fine.
    Has anyone done anything like this before? Did you succeed or fail / change your plans?

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Feb 18, 2011 @ 13:12
    Jeroen Breuer
    0

    Umbraco 4.6 has support for razor controls out of the box and will be heavy improved in the upcoming 4.6.2 version. Can't you just use that?

    Jeroen

  • Gordon Saxby 1444 posts 1855 karma points
    Feb 18, 2011 @ 13:18
    Gordon Saxby
    0

    The client wants to specifically use MVC for developing additional features for a website which will be maintained with Umbraco.

    There is apparently an "in the future" plan to port the site to another "big and fancy" CMS which already supports MVC, so they want to build extra bits using MVC for this - and other reasons (code reuse, etc).

     

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Feb 18, 2011 @ 13:25
    Jeroen Breuer
    0

    Too bad Umbraco 5 won't be out for a while since it's build completely with MVC 3.

    Jeroen

  • Gordon Saxby 1444 posts 1855 karma points
    Feb 18, 2011 @ 13:30
    Gordon Saxby
    0

    Too right - Umbraco 5 would have been ideal :-(

    There must be someone who's done it ... or even someone who has tried and failed ... I need to know if it's possible or not, and if it is - how to do it!

  • Jason Efstathiou 4 posts 24 karma points
    Mar 28, 2011 @ 16:24
    Jason Efstathiou
    0

    Did you manage to use Umbraco 4.* with MVC?  If so I would really appreciate some bullet points on how you did this?

    Jason

  • Gordon Saxby 1444 posts 1855 karma points
    Mar 30, 2011 @ 11:35
    Gordon Saxby
    0

    I got to the point of having an installation of Umbraco 4.6.1 running with a basic MVC application in the same website. I did not get to retrieving info from Umbraco in the MVC app.

    I can't guarantee this is complete, or that all of it is necessary, but ...

    - copy contents of MVC app bin folder to Umbraco bin
    - copy Content, Scripts and Views folders from MVC to Umbraco site

    - add the following to <appSettings> section in web.config

    <add key="ClientValidationEnabled" value="true"/>
    <add key="UnobtrusiveJavaScriptEnabled" value="true"/>       

    - add the following to the <system.web> <pages> section in web.config

    <namespaces>
    <add namespace="System.Web.Mvc"/>
        <add namespace="System.Web.Mvc.Ajax"/>
        <add namespace="System.Web.Mvc.Html"/>
        <add namespace="System.Web.Routing"/>
        <add namespace="System.Linq"/>
        <add namespace="System.Collections.Generic"/>
        <add namespace="System.Web.Helpers"/>
        <add namespace="System.Web.WebPages"/>
    </namespaces>

    - add the following to the <httpModules> section in web.config

    <add name="RegisterRoutesModule" type="RegisterRoutesModule"/>

    - add the following to <assemblies> in web.config

    <add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

     

    you may also need to exclude certain MVC paths in the <umbracoReservedPaths> element.

    I hope that is everything and that it enables you to get started! :-)

     

Please Sign in or register to post replies

Write your reply to:

Draft