Copied to clipboard

Flag this post as spam?

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


  • kylepauljohnson 70 posts 108 karma points
    Mar 15, 2013 @ 16:21
    kylepauljohnson
    0

    BUG? Running Umbraco as Sub Application using MVC Razor View Mode Results In Route Errors

    I think I may have come accross a legitimate bug.  When we are attempting to run Umbraco as a sub application to our custom parent application in IIS.  

    Umbraco installs fine and we are able to install a starter kit and browse it, as well as the Umbraco back end and all works fine.

    When switching the config to use MVC Razor layouts, and changing one of the content types to a razor view, then previewing the page, or viewing it's URL you get this error. 

    Droplr Link (Full Size)

    At first I thought this might be something in our parent application messing with the Umbraco routing engine or something to that effect, so I retried the same setup, but with Umbraco as the parent application and another Umbraco installation as the child instance, and I get the same problem.

    Umbraco 6.2
    IIS 7.5
    SQL DB

    Any thoughts would be appretiated!  Thanks.

     

  • gary 385 posts 916 karma points
    Mar 16, 2013 @ 00:10
    gary
    0

    Hi Kyle

    The issue is probably surrounding the starter kit installation. This will force webforms, if you then change to MVC, it will break.

    I had a similar issue after creating a simple doctype and template, then changing to MVC, it appears you must make the change before you do anything else.

    There is an MVC starter kit, it is a package (project section) you can install after you change the config.

    Hope this helps

    G

  • kylepauljohnson 70 posts 108 karma points
    Mar 16, 2013 @ 00:12
    kylepauljohnson
    0

    I don't beleive that this has anything to do with the starter kit.  I know what your talking about, however in the first instance I did everything from scratch.  The second test I did where I nesded the umbraco applications I installed the starter kit.  So I have done it both routes.  

    In both installations MVC layouts don't work but Master Page layouts do, even if they are applied to the same data type, and you just switch between them.

  • gary 385 posts 916 karma points
    Mar 16, 2013 @ 00:17
    gary
    0

    Hi

    In which config are you changing to MVC Razor Layouts?

    G

  • kylepauljohnson 70 posts 108 karma points
    Mar 16, 2013 @ 00:19
    kylepauljohnson
    0

    When I change, I am changing Config/umbracoSettings.config.  I change the defaultRenderingEngine flag to Mvc.

    I then perform an IIS reset, then go and create a new plain blank MVC Layout template, and assign a datatype to use it. Then I go an update a content node to use that template/layout and get this error.

  • gary 385 posts 916 karma points
    Mar 16, 2013 @ 00:40
    gary
    0

    Hi

    There could be a number of issues I guess, but the part that is most odd is that webforms works but mvc doesn't. This means that your set-up is in webforms, because if it was in mvc, it would be the other way around. 

    If webforms works then the rest from there on is ok, so it has to be in the change in the config to Mvc.

    There is no way to "swap" between the two, so it can only be in one or the other. So, there is something being initialsed in Webforms before the config change that then will not allow the swop.

    The config looks the same as this?

      <templates>
        <!-- If you want to switch to Mvc then do NOT change useAspNetMasterPages to false -->
        <!-- This (old!) setting is still used to control how macros are inserted into your pages -->
        <useAspNetMasterPages>true</useAspNetMasterPages>
    
        <!-- To switch the default rendering engine to MVC, change this value from WebForms to Mvc -->
        <!-- Do not set useAspNetMasterPages to false, it is not relevant to MVC usage -->
        <defaultRenderingEngine>Mvc</defaultRenderingEngine>
      </templates>
    

  • kylepauljohnson 70 posts 108 karma points
    Mar 16, 2013 @ 17:18
    kylepauljohnson
    0

    Gary, yup I understand that you can only run in one mode or the other.  What I was referring to was that if I switch this config from WebForms to Mvc or visa versa.  I can then create a template under that mode (MasterPage or Razoe View).  I then apply that template to a document type and save that, then create or edit a content node with that document type and switch the template to the whichever template corresponds to the mode I am in.

    So when I in Mvc mode all routes fail when using proper razor layout templates.  When using WebForms it works fine.  

    Keep in mind the point that this is a nested application.  I think this is the primary issue here.  If I run the child application as a root application in IIS, then all works as expected.

    So one more time for clarity I am following the steps below when switching modes and testing templates with WebForms and Razor Views.

    1. Switch config value
    2. IIS Reset
    3. Create new template
    4. Update doc type to use new template
    5. Edit/create content node to use new template from doc type
    6. Preview page URL
  • kylepauljohnson 70 posts 108 karma points
    Mar 16, 2013 @ 17:20
    kylepauljohnson
    0

    Gary, yup I understand that you can only run in one mode or the other.  What I was referring to was that if I switch this config from WebForms to Mvc or visa versa.  I can then create a template under that mode (MasterPage or Razoe View).  I then apply that template to a document type and save that, then create or edit a content node with that document type and switch the template to the whichever template corresponds to the mode I am in.

    So when I in Mvc mode all routes fail when using proper razor layout templates.  When using WebForms it works fine.  

    Keep in mind the point that this is a nested application.  I think this is the primary issue here.  If I run the child application as a root application in IIS, then all works as expected.

    So one more time for clarity I am following the steps below when switching modes and testing templates with WebForms and Razor Views.

    1. Switch config value
    2. IIS Reset
    3. Create new template
    4. Update doc type to use new template
    5. Edit/create content node to use new template from doc type
    6. Preview page URL
  • Pavel Gurecki 55 posts 158 karma points
    Mar 21, 2013 @ 17:21
    Pavel Gurecki
    0

    Hi

    Any progress with this issue?

    I am thinking about installing Umbraco 6 under default website as web application, but have some doubts about that because installation documentation states:
    "[...] be certain to leave the Application Name field blank, otherwise the installer will place Umbraco into a sub folder under a web root, which is not supported"

    I hope this is outdated documentation and this issue is fixed in Umbraco 6, but as this thread shows it might not. Any comments regarding this would be helpful.

  • kylepauljohnson 70 posts 108 karma points
    Mar 21, 2013 @ 17:23
    kylepauljohnson
    0

    Unfortunatly not.  We can only get WebForms to work as of now.  Razor views continue to fail with the umbraco/RenderMvc 404 error.

  • Sébastien Richer 194 posts 430 karma points
    May 09, 2013 @ 16:15
    Sébastien Richer
    0

    Hello Kyle,

    I can't help you with your issue (yet), I'm still trying to get my umbraco to run at least a bit correctly in a sub-application to my MVC4 web application. I posted to stack here http://stackoverflow.com/questions/16449778/path-problems-with-running-a-sub-application-umbraco-inside-my-mvc4-web-applic. But basically I'm having trouble getting my paths aligned correctly, what settings do you use in manage hostnames?

    My umbraco site has a structure like this:

    - Content
    - Site
    - English
    -Pages...
    - French
    - Pages... 

    And my MVC4 web-app has a structure like this:

    - myApp.local/          --> MVC4
    - myApp.local/site/    --> IIS application mapped to my Umbraco site

    Thanks for the help!

  • kylepauljohnson 70 posts 108 karma points
    May 09, 2013 @ 17:23
    kylepauljohnson
    0

    Currently I don't use hostnames.  It was recommended to at one point that I try and use them, which I did with no luck. 

  • Sébastien Richer 194 posts 430 karma points
    May 09, 2013 @ 17:24
    Sébastien Richer
    0

    Hmm... I see, so basically, you don't have a setup like I do with Site -> Language, I guess I would setup rewrite rules for those... hmmm...

  • kylepauljohnson 70 posts 108 karma points
    May 09, 2013 @ 17:26
    kylepauljohnson
    0

    For me the parent application is a custom written application that doesn't use Umbraco at all.  Umbraco sits in a subfolder/application folder of that site.

  • Nikolay Arhangelov 15 posts 34 karma points
    Aug 20, 2013 @ 14:15
    Nikolay Arhangelov
    0

    Hello,

    I am having a similar issue - I am doing a migration of a website from another CMS to Umbraco v6 (currently 6.1.3) with MVC. I want to gradually replace different sections of the existing site with Umbraco and I have the following setup in IIS:

    • mix.domain.local (just an empty site)
      • old (old website)
      • new (Umbraco as a sub application)

    The idea is to use mix.domain.local with rewriting rules to redirect to the new sections.

    Entering mix.domain.local/new/umbraco shows the backoffice, but the dashboard controls do not load. Also when I enter mix.domain.local/new it does not show the homepage of the Umbraco site - the routing does not work and it does not find /umbraco/RenderMvc.

    The specific Umbraco settungs are: umbracoUseDirectoryUrls - true

    I also have domains in the Umbraco installation - domain.local, dev.domain.local

    I tried settings ResolveUrlsFromTextString to true but it didn't work.

    Did anyone manage to find a solution to the issue?

    Thanks!

Please Sign in or register to post replies

Write your reply to:

Draft