Search code examples
c#asp.net.netiis-express

IIS Not Receiving Updates to HTML?


I am working on a .NET Core 3.1 project in Visual Studio. Before I upgraded from 2.1 to 3.1 and VS2017 to VS2019 I was able to change html/css/js and refresh the browser to receive the updated files. Since the upgrade however, I have to stop IIS Express and relaunch it for every change I make. This slows down any front-end work considerably.

I have tried using incognito windows, clearing the cache, different OS, etc., but that has not worked.

Edit: site.css gets updated when I refresh but the other css and html files don't.

Any help would be greatly appreciated.


Solution

  • Try adding Nuget package

    Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation
    

    to your web project and adding

    "environmentVariables": {
       "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation"
    }
    

    to your profile in launchSettings.json.