skip to Main Content

So I am trying out .NET 6 for the first time. I created an empty web app based on .NET 6. It does NOT have docker support and I have changed nothing in the code.

When I run in IISExpress with the debugger (using F5) from VS2022, the site runs but each page load takes 2 seconds every time I go between "Home" and "Privacy". These are Razor pages in the sample but another app I was starting to build was also slow with controller actions. In the network tab, it is only the main request which is slow. Other js files are loaded quickly from the app and then cached.

Surely this can’t be right?

3

Answers


  1. I have encounter the same problem, and solve it with different ways:

    • If you are in "In private" navigation, open another web borswer window without "In private".
    • Otherwise, use another web browser

    I know that’s not correct the issue, but it’s an helpful workaround.

    Login or Signup to reply.
  2. Since you are saying you run with IIS Express, this may not work for you. If you weren’t actually running with IIS Express, but instead the default project executable it may.

    Try the following:

    • Close the project (possibly all Visual Studio instances)
    • Open the project
    • Switch it to run on IIS Express profile (dropdown beside the green run button)
    • Run the project.

    Closing Visual Studio seemed key to getting it out of the 2s reload.

    My .NET 6 projects were having the same 2 page load times, even after repeat visits. If I freshly ran with my project profile instead and then the IIS Express one, the issue was there with both methods. If I freshly ran the IIS Express profile, then switch it to my project that now works fine. I’m just leaving it on IIS Express for now until I find a reason not to or it gets fixed. I have no idea on the underlying issue.

    Login or Signup to reply.
  3. I have had this exact same issue for some time – consistent 2 second page load on a fresh template MVC project (.NET 6 and now .NET 7 as well) while lightning fast if published, run in the profiler or via Postman. The solution for me was to disable ‘CSS Hot Reload’ under Options > Projects and Solutions > ASP.NET Core.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search