asp.net-core.net-coreiiskentico

Kentico 13 .Net Core working on IIS Express but not on IIS


I'm getting this error suddenly (wasn't an issue before) when launching the site with IIS but am having no issue when running the site on IIS Express. I've double checked the names of the areas in the code and nothing has changed (if they had, the IIS express version wouldn't work as it's the same database).

When looking at the live site on IIS, it just shows a blank page with the following source:

<!DOCTYPE html>
<html>
<head id="head" class="default-layout">
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta charset="UTF-8" />
    <title> - Test</title>   
</head>
<body>
    <header>
        <vc:master-page-header />
    </header>
    <vc:wide />
    <vc:master-page-footer />
    <script rel='preload' src='https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js'></script>
    <vc:nba-view-box />
    <vc:overlay-repeater />
</body>
</html>

The <vc:wide /> view component is my expected template but when I put a breakpoint in there it doesn't hit. Again, works fine in IIS Express but not in IIS.

The browser debugger doesn't give me anything useful, neither does the event log.

I stopped the site and app pool, deleted the /bin and /obj folders, cleaned and rebuilt the solution and restarted the site but the issue still persists.

I've also double checked the Presentation URL and the Physical Path for the IIS Site

I suspect it may have something to do with the Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation package. Which version should I have installed for Hotfix v13.0.83? I have 6.0.14 installed.


Solution

  • This sounds like your ViewComponents aren't rendering and just outputting the tags to the HTML?

    This was a bug in the recent .NET SDK released: https://github.com/dotnet/razor/issues/8281#issuecomment-1468780770

    I think you should just be able to download the latest .NET SDK and it will work.