Migration from IIS 6 Server 2003 to IIS 10 Server 2019: Why won't .aspx files compile?

harry stergakos 1 Reputation point
2022-03-08T14:17:07.79+00:00

I am migrating a website from IIS v6 on Windows Server 2003 to IISv10 on Windows Server 2019. I used the IIS Easy Migration Tool to perform the migration. Most of the webpages on the site load fine. Web pages ending in .asp load fine, while pages ending in .aspx will not compile and a 404 error is thrown.

I have already installed ASP.NET on the 2019 server.

Do I need an older version of ASP.NET to compile these pages? or is there a step I'm missing during the migration?

Any help is appreciated :)

Windows development | Internet Information Services
{count} votes

2 answers

Sort by: Most helpful
  1. Jose Zero 576 Reputation points
    2022-03-08T14:50:23.827+00:00

    Check this thread (similar issue) , see if it helps iis-10-on-windows-server-2016-not-running-my-asp-net-mvc-website

    0 comments No comments

  2. Michael Taylor 60,161 Reputation points
    2022-03-08T15:31:57.167+00:00

    There isn't sufficient information to really narrow this down so there could be any # of things going wrong. Let's start with the fact that you mentioned Server 2003 but now on Server 2019 so IIS has changed how it works with managed code and your site might need to using a different set of app pool options for compatibility reasons.

    Another concern is that you probably didn't upgrade your app's framework version and therefore that version of the framework needs to be installed on the new server OR you need to upgrade your app's framework first. If the framework was really, really old then IIS might not even support it anymore.

    Yet another thing is that installing ASP.NET by itself isn't sufficient for IIS. For ASP.NET you also need to register it with IIS (and generally reset IIS) before it'll work. However if you are using a version that ships with Windows (aka you installed from the Windows Features section) then it would have handled that for you already.

    Continuing on the possible changes, in old versions of IIS then the web server didn't understand managed code so everything was configured differently than in newer versions. In newer IIS versions the app's web.config has a system.webServer that now stores a lot of the IIS configuration. Therefore your app needs to be updated to store some settings there. But older framework versions won't work with the newer config section as they don't understand it.

    Honestly I think the correct solution for most sites is to create a new website/web app, point it to your app's directory and reconfigure things. Given the age of your web app/IIS compared to the new server it likely isn't going to work out of the box without upgrading. If you've been upgrading the app over the years so you're on a .NET 4.x version then your app should transition across just fine in most cases.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.