locked
IIS deploy - Cannot load .cshtml RRS feed

  • Question

  • User1778503488 posted

    Hi,

    I'm not sure this is the right place to post. However my problem... I have deployed my web app (asp.net mvc 5) to IIS but when I try to access the first page that doesn't load. What I get is an empty page. Opening the console show me:

    So I get the .js but not the .chtml (login in this example). The error in detail on login page request:

    However if i put directly the link in the browser (with the context 'RCM') I get the page (obviously css missing):

    Some advice to get all working?

    Note: the link called when I click Browse on my webApp in IIS:

    Friday, December 16, 2016 1:25 PM

Answers

All replies

  • User-2057865890 posted

    Hi Mond0,

    Following are the possible causes/ fixes for this.

    *Make sure the Application pool targets correct version of .NET framework (i.e .NET Framework v4.0.30319 for .NET 4 and 4.5)
    *Make sure the Pipeline mode of IIS Application pool is "Integrated"
    *Check UrlRoutingModule-4.0 is added in the modules of that website.
    *Under CMD, run the following two commands, re register IIS.(reference: https://msdn.microsoft.com/en-us/library/k6h9cz8h.aspx)
         32-bit systems
            C:\Users\Administrator>cd C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\
            aspnet_regiis -i
        64-bit systems
            C:\Users\Administrator>cd C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\
            aspnet_regiis -i

    Best Regards,

    Chris

    Friday, December 16, 2016 4:39 PM
  • User1778503488 posted

    Hi,

    Thanks for your reply. I have followed your suggests but nothing works :-(

    Friday, December 16, 2016 5:54 PM
  • User-2057865890 posted

    Hi mond0,

    Try https://svenaelterman.wordpress.com/2011/01/31/using-asp-net-4-0-extension-less-routing-on-iis-7-5/ 

    Besides, please consider posting IIS related questions to http://forums.iis.net/.You may get quicker and better response there.

    Best Regards,

    Chris

    Monday, December 19, 2016 2:23 AM
  • User1778503488 posted

    Hi, 

    I have installed the hotfix suggests in that guide --> it's not working. As you suggests I have also posted on http://forums.iis.net/.

    Anyway I'm totally noob about deploying in general Laughing but seems it's just missing the context (RCM in my case, the name of the root folder of my application) when various pages are called.

    Monday, December 19, 2016 8:00 AM
  • User753101303 posted

    Hi,

    So it seems the view is requested using /account/login using an Ajax request? What if you try /rcm/account/login instead ? For now my understanding would be that your site is deployed under a web application root rather than at the root of the web site... And so links that worked on your local machine are not correct anymore once deployed.

    Monday, December 19, 2016 11:18 AM
  • User1778503488 posted

    Yes, if I try /rcm/account/login I get the page. Since what I'm doing:

    - app.js (angular routing)

    .state('loginPage', {
                url: '/login',
                views: {
                    'mainContent': {
                        controller: 'loginController',
                        templateUrl: 'Account/login'
                    }
                },
                authenticate: false
            })

    - here an example of the controller in the server code:

            public ActionResult Login()
            {
                return View();
            }

    It should return the correct partial view. 

    Am I missing something to configure about Asp.Net routing?

    Here, if can help, my RouteConfig.cs:

    routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
    
                routes.MapRoute(
                    name: "Default",
                    url: "{controller}/{action}/{id}",
                    defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
                );

    in App_Start

    Monday, December 19, 2016 1:14 PM
  • User-2057865890 posted

    Hi Mond0,

    Try 

    Step 1: Remove the Hash
    Step 2: Handle Routes on the Server
    Step 3: Setting the Base Tag

    reference: https://www.codeproject.com/tips/1063634/removing-the-sharp-sign-from-angularjs-urls-with-i

    Best Regards,

    Chris

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, December 28, 2016 10:18 AM
  • User1778503488 posted

    Hi,

    thanks for your reply. I found a solution. It was all about routing. What I had to do was simply add "a base" to my application:

    <base href="/RCM/" />

    in the index.html (/RCM/ in my case).

    Thursday, January 5, 2017 1:43 PM